jihoonson commented on a change in pull request #5958: Part 2 of changes for 
SQL Compatible Null Handling
URL: https://github.com/apache/incubator-druid/pull/5958#discussion_r204942853
 
 

 ##########
 File path: processing/src/main/java/io/druid/query/filter/InDimFilter.java
 ##########
 @@ -121,21 +116,30 @@ public ExtractionFn getExtractionFn()
     final byte[][] valuesBytes = new byte[values.size()][];
     int valuesBytesSize = 0;
     int index = 0;
+    boolean hasNull = false;
     for (String value : values) {
+      if (value == null) {
+        hasNull = true;
+      }
+      //CHECKSTYLE.OFF: Regexp
+      // Strings.nullToEmpty is safe to use here as we have encoded 
nullability in hasNull flag.
       valuesBytes[index] = StringUtils.toUtf8(Strings.nullToEmpty(value));
+      //CHECKSTYLE.ON: Regexp
       valuesBytesSize += valuesBytes[index].length + 1;
       ++index;
     }
     byte[] extractionFnBytes = extractionFn == null ? new byte[0] : 
extractionFn.getCacheKey();
 
-    ByteBuffer filterCacheKey = ByteBuffer.allocate(3
+    ByteBuffer filterCacheKey = ByteBuffer.allocate(5
 
 Review comment:
   nit: can we use `CacheKeyBuilder` here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@druid.apache.org
For additional commands, e-mail: dev-h...@druid.apache.org

Reply via email to