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


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/DataSchema.java:
##########
@@ -334,9 +311,64 @@ public DataType toDataType() {
       }
     }
 
+    /**
+     * Converts to the internal representation of the value.
+     * <ul>
+     *   <li>BOOLEAN: boolean -> int</li>
+     *   <li>TIMESTAMP: Timestamp -> long</li>
+     *   <li>BYTES: byte[] -> ByteArray</li>
+     *   <li>BOOLEAN_ARRAY: boolean[] -> int[]</li>
+     *   <li>TIMESTAMP_ARRAY: Timestamp[] -> long[]</li>
+     * </ul>
+     */
+    public Object toInternal(Object value) {
+      switch (this) {
+        case BOOLEAN:
+          return ((boolean) value) ? 1 : 0;

Review Comment:
   Added more comments explaining it. The internal stored type for BOOLEAN is 
INT (similarly the stored type for TIMESTAMP is LONG), and we always use the 
stored type throughout the engine



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