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


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/RexExpressionUtils.java:
##########
@@ -264,6 +271,9 @@ private static RexExpression.Literal 
fromRexLiteralValue(ColumnDataType dataType
       case BYTES:
         value = new ByteArray(((ByteString) value).getBytes());
         break;
+      case UUID:
+        value = new ByteArray(UuidUtils.toBytes((UUID) value));

Review Comment:
   Is the value guaranteed to be `UUID` here?



##########
pinot-query-planner/src/main/java/org/apache/pinot/query/parser/CalciteRexExpressionParser.java:
##########
@@ -146,6 +147,8 @@ public static Literal toLiteral(RexExpression.Literal 
literal) {
       value = BooleanUtils.isTrueInternalValue(value);
     } else if (dataType == ColumnDataType.BYTES) {
       value = ((ByteArray) value).getBytes();
+    } else if (dataType == ColumnDataType.UUID) {
+      value = UuidUtils.toUUID((ByteArray) value);

Review Comment:
   This involves back and forth conversion from bytes to UUID. Can we directly 
use bytes?



##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/RexExpressionUtils.java:
##########
@@ -149,6 +151,11 @@ public static RexLiteral toRexLiteral(RelBuilder builder, 
RexExpression.Literal
         ByteString byteString = new ByteString(bytes);
         return rexBuilder.makeBinaryLiteral(byteString);
       }
+      case UUID:
+        if (value == null) {

Review Comment:
   Why is this not aligned with other types?



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