clintropolis commented on code in PR #14542:
URL: https://github.com/apache/druid/pull/14542#discussion_r1264297847


##########
processing/src/main/java/org/apache/druid/segment/index/IndexedUtf8ValueSetIndex.java:
##########
@@ -85,20 +92,33 @@ public <T> T computeBitmapResult(BitmapResultFactory<T> 
bitmapResultFactory)
 
       private ImmutableBitmap getBitmapForValue()
       {
-        final ByteBuffer valueUtf8 = value == null ? null : 
ByteBuffer.wrap(StringUtils.toUtf8(value));
-        final int idx = dictionary.indexOf(valueUtf8);
+        final int idx = 
dictionary.indexOf(StringUtils.toUtf8ByteBuffer(value));
         return getBitmap(idx);
       }
     };
   }
 
+  @Nullable
+  @Override
+  public BitmapColumnIndex forValue(Object value, TypeSignature<ValueType> 
valueType)
+  {
+    if (valueType.isPrimitive()) {
+      return forValue(
+          ExprEval.ofType(ExpressionType.fromColumnTypeStrict(valueType), 
value)
+                  .castTo(ExpressionType.STRING)
+                  .asString()
+      );

Review Comment:
   changed to convert to utf8 eagerly, but inside of the forValue method since 
it is shared between the two implementations



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to