robinyqiu commented on a change in pull request #13483:
URL: https://github.com/apache/beam/pull/13483#discussion_r538849960
##########
File path:
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/SqlOperators.java
##########
@@ -81,6 +72,12 @@
x -> createTypeFactory().createSqlType(SqlTypeName.VARCHAR),
new UdafImpl<>(new StringAgg.StringAggString()));
+ public static final SqlOperator ARR_AGG_ARR_FN =
+ createUdafOperator(
+ "array_agg",
+ x -> createTypeFactory().createSqlType(SqlTypeName.ARRAY),
Review comment:
Here you simply created an array type without specifying the element
type. I guess that's why the error message says the "inferred type is ARRAY NOT
NULL" (just array type, your can ignore the "NOT NULL" suffix), where it should
be "BIGINT NOT NULL ARRAY NOT NULL" (array of bigint).
To create an array type with element type specified, you may want to use
`createTypeFactory().createArrayType()`, like here:
https://github.com/robinyqiu/beam/blob/cbe87445d4259b6b485bc010231dda1895022d83/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlCalciteTranslationUtils.java#L170
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]