[
https://issues.apache.org/jira/browse/BEAM-9890?focusedWorklogId=450631&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-450631
]
ASF GitHub Bot logged work on BEAM-9890:
----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Jun/20 20:57
Start Date: 24/Jun/20 20:57
Worklog Time Spent: 10m
Work Description: Imfuyuwei commented on a change in pull request #12079:
URL: https://github.com/apache/beam/pull/12079#discussion_r445167391
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/transform/BeamBuiltinAggregations.java
##########
@@ -383,4 +392,30 @@ public Long extractOutput(Long accum) {
return accum;
}
}
+
+ static class BitAnd<T extends Number> extends CombineFn<T, Long, Long> {
+ @Override
+ public Long createAccumulator() {
+ return -1L;
Review comment:
Thanks!
BTW I want to mention that I also added 1 line at the end of the previous
testBitOrFunction(). I noticed that without this line, the previous bit_or test
will always no matter what expected result I set, which makes it an invalid
test.
It will be good if you can take a look.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 450631)
Time Spent: 1h 10m (was: 1h)
> Support BIT_AND aggregation function in BeamSQL
> -----------------------------------------------
>
> Key: BEAM-9890
> URL: https://issues.apache.org/jira/browse/BEAM-9890
> Project: Beam
> Issue Type: Task
> Components: dsl-sql, dsl-sql-zetasql
> Reporter: Rui Wang
> Assignee: Yuwei Fu
> Priority: P2
> Labels: starter
> Fix For: Not applicable
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Performs a bitwise AND operation on expression and returns the result.
> Supported Argument Types: INT64
> Returned Data Types: INT64
> Examples
> {code:sql}
> SELECT BIT_AND(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_and
--
This message was sent by Atlassian Jira
(v8.3.4#803005)