xiangfu0 commented on code in PR #19247:
URL: https://github.com/apache/pinot/pull/19247#discussion_r3788727496
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/operands/TransformOperandFactory.java:
##########
@@ -77,8 +79,61 @@ private static TransformOperand
getTransformOperand(RexExpression.FunctionCall f
return new FilterOperand.Predicate(operands, dataSchema, v -> v < 0);
case "LESS_THAN_OR_EQUAL":
return new FilterOperand.Predicate(operands, dataSchema, v -> v <= 0);
+ case "ARRAY_VALUE_CONSTRUCTOR":
+ return getArrayValueConstructorOperand(functionCall, dataSchema);
default:
return new FunctionOperand(functionCall, dataSchema);
}
}
+
+ private static TransformOperand
getArrayValueConstructorOperand(RexExpression.FunctionCall functionCall,
+ DataSchema dataSchema) {
+ if (functionCall.getDataType() == ColumnDataType.BYTES_ARRAY) {
+ List<RexExpression> operands = functionCall.getFunctionOperands();
+ ByteArray[] values = new ByteArray[operands.size()];
+ for (int i = 0; i < operands.size(); i++) {
+ RexExpression operand = operands.get(i);
+ if (!(operand instanceof RexExpression.Literal)) {
+ return new FunctionOperand(functionCall, dataSchema);
Review Comment:
Addressed in 0a1c33347c. `BytesArrayDynamicOperand` now evaluates BYTES
children internally, reuses existing `ByteArray` wrappers and backing `byte[]`
values, and allocates only the required outer `ByteArray[]` or `byte[][]` per
row. `TransformOperatorTest` covers mixed literal/reference operands,
wrapper/backing-array identity, and distinct outer arrays; 9/9 tests passed
through the 20-module reactor. The full `BytesMvTypeTest` E2E also passed 14/14.
##########
pinot-common/src/main/java/org/apache/pinot/sql/parsers/PostgreSqlByteaLiteralRewriter.java:
##########
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.sql.parsers;
+
+import java.util.List;
+import org.apache.calcite.sql.SqlBinaryStringLiteral;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlCharStringLiteral;
+import org.apache.calcite.sql.SqlDataTypeSpec;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.fun.SqlLibraryOperators;
+import org.apache.calcite.sql.util.SqlShuttle;
+
+
+/// Normalizes PostgreSQL hex-format BYTEA literals to Calcite binary literals
before validation or Pinot query
+/// conversion. This deliberately supports only quoted constants so it cannot
introduce engine-specific per-row
+/// STRING-to-BYTES cast behavior.
+final class PostgreSqlByteaLiteralRewriter extends SqlShuttle {
Review Comment:
Split as requested. The PostgreSQL parser/cast commit has been removed from
#19247, and the PR body now documents only core BYTES_ARRAY support. The
preserved parser work is published as dependent draft #19263:
https://github.com/apache/pinot/pull/19263. That follow-up is one commit above
the final #19247 core head and has fresh parser, broker, planner, runtime, and
both-engine E2E validation.
--
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]