Jackie-Jiang commented on code in PR #18170:
URL: https://github.com/apache/pinot/pull/18170#discussion_r3068907121


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/dictionary/SameValueMutableDictionary.java:
##########
@@ -22,21 +22,24 @@
 import java.io.IOException;
 import java.math.BigDecimal;
 import org.apache.pinot.segment.spi.index.mutable.MutableDictionary;
-import org.apache.pinot.spi.data.FieldSpec;
+import org.apache.pinot.spi.data.FieldSpec.DataType;
+import org.apache.pinot.spi.utils.Utf8Utils;
+
 
 /**
  * SameValueMutableDictionary is used to wrap any MutableDictionary, but store 
the same value. This is done to
  * allow noRawDataForTextIndex config to work with mutable indexes.
  */
 public class SameValueMutableDictionary implements MutableDictionary {
-
-  private final Object _actualValue;
-  private final Object[] _actualValues;
+  private final String _actualValue;
+  private final String[] _actualValues;
+  private final byte[] _valueBytes;
   private final MutableDictionary _delegate;
 
-  public SameValueMutableDictionary(Object value, MutableDictionary delegate) {
-    _actualValue = value;
-    _actualValues = new Object[]{value};
+  public SameValueMutableDictionary(Object actualValue, MutableDictionary 
delegate) {
+    _actualValue = actualValue.toString();
+    _actualValues = new String[]{_actualValue};
+    _valueBytes = Utf8Utils.encode(_actualValue);

Review Comment:
   This class is a hack for text index when user doesn't want to keep the raw 
values, where the value here can only be `STRING` type.
   We should consider cleaning it up



-- 
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