You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "imply-cheddar (via GitHub)" <gi...@apache.org> on 2023/05/11 23:25:30 UTC

[GitHub] [druid] imply-cheddar commented on a diff in pull request #14262: fix segment metadata queries for auto ingested columns that had all null values

imply-cheddar commented on code in PR #14262:
URL: https://github.com/apache/druid/pull/14262#discussion_r1191771042


##########
processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java:
##########
@@ -282,6 +282,10 @@ public ColumnCapabilities getColumnCapabilities()
 
   private ColumnType getLogicalType()
   {
+    if (fieldIndexers.isEmpty()) {
+      // we didn't see anything, so we can be anything, so why not a string?
+      return ColumnType.STRING;

Review Comment:
   Stream of conciousness: I wonder if we need a `ColumnType.NULL` to indicate something that can become anything else, but will always be null?



##########
processing/src/test/java/org/apache/druid/segment/TestHelper.java:
##########
@@ -484,6 +484,17 @@ public static Map<String, Object> makeMap(boolean explicitNulls, Object... vals)
     return theVals;
   }
 
+  public static Map<String, Object> makeMapWithExplicitNull(Object... vals)

Review Comment:
   My guess: the JVM doesn't like to statically put `null` into an Object[].  You can try, perhaps calling `makeMap(true, new Object[]{1234L, "x", null}...)`
   
   Or this is fine too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org