[ https://issues.apache.org/jira/browse/BEAM-9984?focusedWorklogId=434582&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-434582 ]
ASF GitHub Bot logged work on BEAM-9984: ---------------------------------------- Author: ASF GitHub Bot Created on: 18/May/20 19:48 Start Date: 18/May/20 19:48 Worklog Time Spent: 10m Work Description: amaliujia commented on a change in pull request #11737: URL: https://github.com/apache/beam/pull/11737#discussion_r426856451 ########## File path: sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/transform/BeamBuiltinAggregations.java ########## @@ -171,10 +173,18 @@ static CombineFn createAvg(Schema.FieldType fieldType) { return new BigDecimalAvg(); default: throw new UnsupportedOperationException( - String.format("[%s] is not support in AVG", fieldType)); + String.format("[%s] is not supported in AVG", fieldType)); } } + static CombineFn createBitOr(Schema.FieldType fieldType) { + if (fieldType.getTypeName() == TypeName.INT64) { + return new BitOr(); + } + throw new UnsupportedOperationException( + String.format("[%s] is not supported in BIT_OR", fieldType)); Review comment: Ah I didn't realized that Calcite does not do type validation on argument type for a specific function. ZetaSQL does it. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 434582) Time Spent: 50m (was: 40m) > Support BIT_OR aggregation function in Beam SQL > ----------------------------------------------- > > Key: BEAM-9984 > URL: https://issues.apache.org/jira/browse/BEAM-9984 > Project: Beam > Issue Type: Task > Components: dsl-sql, dsl-sql-zetasql > Reporter: Kenneth Knowles > Assignee: Omar Ismail > Priority: P2 > Labels: starter > Time Spent: 50m > Remaining Estimate: 0h > > Performs a bitwise OR operation on expression and returns the result. > Supported Argument Types: INT64 > Returned Data Types: INT64 > Examples > {code:sql} > SELECT BIT_OR(c) as bit_and FROM UNNEST([0xF001, 0x00A1]) as c; > +---------+ > | bit_and | > +---------+ > | 1 | > +---------+ > {code} > What is expected: should include both Calcite and ZetaSQL dialects. > How to test: unit tests > Reference: > https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions#bit_or -- This message was sent by Atlassian Jira (v8.3.4#803005)