robinyqiu commented on a change in pull request #13483:
URL: https://github.com/apache/beam/pull/13483#discussion_r538842532



##########
File path: 
sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlDialectSpecTest.java
##########
@@ -4067,4 +4060,21 @@ public void testSimpleTableName() {
             Row.withSchema(singleField).addValues(15L).build());
     
pipeline.run().waitUntilFinish(Duration.standardMinutes(PIPELINE_EXECUTION_WAITTIME_MINUTES));
   }
+
+  @Test
+  public void testArrayAggregation() {
+    String sql =
+            "SELECT ARRAY_AGG(x) AS array_agg\n" +
+                    "FROM UNNEST([2, 1, -2, 3, -2, 1, 2]) AS x";
+
+    ZetaSQLQueryPlanner zetaSQLQueryPlanner = new ZetaSQLQueryPlanner(config);
+    BeamRelNode beamRelNode = zetaSQLQueryPlanner.convertToBeamRel(sql);
+    PCollection<Row> stream = BeamSqlRelUtils.toPCollection(pipeline, 
beamRelNode);
+
+    Schema schema = Schema.builder().addArrayField("array_field", 
FieldType.of(Schema.TypeName.ARRAY)).build();

Review comment:
       I think here we expect schema:
   
   ```
   Schema schema = Schema.builder().addArrayField("array_field", 
FieldType.of(FieldType.INT64)).build();
   ```
   
   meaning it is an "array of int64"




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


Reply via email to