You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/02/08 22:26:52 UTC

[GitHub] [beam] robinyqiu commented on a change in pull request #13895: [BEAM-11743] countif aggregate function implementation for zetasql dialect

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



##########
File path: sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/SqlOperators.java
##########
@@ -171,6 +172,12 @@
           x -> createTypeFactory().createSqlType(SqlTypeName.BIGINT),
           new UdafImpl<>(new BeamBuiltinAggregations.BitXOr<Number>()));
 
+  public static final SqlOperator COUNTIF =
+      createUdafOperator(
+          "countif",
+          x -> createTypeFactory().createSqlType(SqlTypeName.BOOLEAN),

Review comment:
       Hi Sonam, I believe the type mismatch error comes from this line.
   
   The type specified here should be the *return* type of `COUNT_IF`, which is `BIGINT` instead of `BOOLEAN`.




----------------------------------------------------------------
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:
users@infra.apache.org