sonam-vend commented on a change in pull request #13817:
URL: https://github.com/apache/beam/pull/13817#discussion_r579807048
##########
File path:
sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlDialectSpecTest.java
##########
@@ -4114,4 +4114,85 @@ public void testCountIfZetaSQLDialect() {
pipeline.run().waitUntilFinish(Duration.standardMinutes(PIPELINE_EXECUTION_WAITTIME_MINUTES));
}
+
+ @Test
+ public void testLogicalAndZetaSQL() {
+ String sql = "SELECT LOGICAL_AND(x) AS logical_and FROM UNNEST([true,
false, true]) AS x";
+
+ ZetaSQLQueryPlanner zetaSQLQueryPlanner = new ZetaSQLQueryPlanner(config);
+ BeamRelNode beamRelNode = zetaSQLQueryPlanner.convertToBeamRel(sql);
+ PCollection<Row> stream = BeamSqlRelUtils.toPCollection(pipeline,
beamRelNode);
+
+ Schema singleField = Schema.builder().addBooleanField("field1").build();
+
PAssert.that(stream).containsInAnyOrder(Row.withSchema(singleField).addValues(false).build());
+
pipeline.run().waitUntilFinish(Duration.standardMinutes(PIPELINE_EXECUTION_WAITTIME_MINUTES));
+ }
+
+ @Test
+ public void testLogicalAndZetaSQLWithAllTrueValues() {
Review comment:
testLogicalAndZetaSQLWithAllTrueValues fails because of [BEAM-9514](
https://issues.apache.org/jira/browse/BEAM-9514)
----------------------------------------------------------------
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]