Jackie-Jiang commented on code in PR #19247:
URL: https://github.com/apache/pinot/pull/19247#discussion_r3848198654
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java:
##########
@@ -155,6 +156,14 @@ public static Literal getLiteral(byte[] value) {
return Literal.binaryValue(value);
}
+ public static Literal getLiteral(byte[][] value) {
Review Comment:
Put this after `String[]`. Same for other places
##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArrayFunctions.java:
##########
@@ -302,6 +302,26 @@ public static Object arrayValueConstructor(Object... arr) {
if (arr == null || arr.length == 0) {
return arr;
}
+ boolean containsBytes = false;
Review Comment:
Can we follow the existing convention? The `byte[]` should follow the
`String` check, and only based on the first element
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/parser/CalciteRexExpressionParser.java:
##########
@@ -146,6 +146,8 @@ public static Literal toLiteral(RexExpression.Literal
literal) {
value = BooleanUtils.isTrueInternalValue(value);
} else if (dataType == ColumnDataType.BYTES || dataType ==
ColumnDataType.UUID) {
value = ((ByteArray) value).getBytes();
+ } else if (dataType == ColumnDataType.BYTES_ARRAY) {
Review Comment:
Could this be `UUID_ARRAY`?
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/parser/CalciteRexExpressionParser.java:
##########
@@ -146,6 +146,8 @@ public static Literal toLiteral(RexExpression.Literal
literal) {
value = BooleanUtils.isTrueInternalValue(value);
} else if (dataType == ColumnDataType.BYTES || dataType ==
ColumnDataType.UUID) {
value = ((ByteArray) value).getBytes();
+ } else if (dataType == ColumnDataType.BYTES_ARRAY) {
+ value = dataType.toExternal(value);
Review Comment:
Inline the handling to avoid the switch
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/utils/TypeUtils.java:
##########
@@ -132,6 +132,18 @@ public static Object convert(Object value, ColumnDataType
storedType) {
// For ArrayAggregationFunction
return ArrayListUtils.toBytesArray((ObjectArrayList<ByteArray>)
value);
}
+ if (value instanceof Object[] && ((Object[]) value).length == 0) {
Review Comment:
This shouldn't be needed
--
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]