Jackie-Jiang commented on code in PR #19247:
URL: https://github.com/apache/pinot/pull/19247#discussion_r3855871526
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/ArrayLiteralTransformFunction.java:
##########
@@ -119,12 +135,26 @@ public
ArrayLiteralTransformFunction(List<ExpressionContext> literalContexts) {
_floatArrayLiteral = new float[0];
_doubleArrayLiteral = new double[0];
_stringArrayLiteral = new String[0];
+ _bytesArrayLiteral = new byte[0][];
return;
}
for (ExpressionContext literalContext : literalContexts) {
Preconditions.checkState(literalContext.getType() ==
ExpressionContext.Type.LITERAL,
"ArrayLiteralTransformFunction only takes literals as arguments,
found: %s", literalContext);
}
+ boolean containsBytes = false;
+ for (ExpressionContext literalContext : literalContexts) {
+ if (literalContext.getLiteral().getType() == DataType.BYTES) {
+ containsBytes = true;
+ break;
+ }
+ }
+ if (containsBytes) {
+ for (ExpressionContext literalContext : literalContexts) {
+ Preconditions.checkState(literalContext.getLiteral().getType() ==
DataType.BYTES,
+ "BYTES array literals only support non-null BYTES elements, found:
%s", literalContext);
+ }
+ }
Review Comment:
Remove this check for consistency. We don't have this check for other types
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/utils/TypeUtils.java:
##########
@@ -132,6 +132,14 @@ public static Object convert(Object value, ColumnDataType
storedType) {
// For ArrayAggregationFunction
return ArrayListUtils.toBytesArray((ObjectArrayList<ByteArray>)
value);
}
+ if (value instanceof byte[][]) {
Review Comment:
Is this branch every hit? The type should be deterministic, and it should be
`ByteArray[]` if wired correctly
--
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]