[
https://issues.apache.org/jira/browse/CALCITE-3732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17021473#comment-17021473
]
Julian Hyde commented on CALCITE-3732:
--------------------------------------
Yes, let's go with that. Thus:
* Scalar functions: BITAND, BITNOT, BITANDNOT, BITOR, BITSHIFTLEFT,
BITSHIFTRIGHT, BITXOR, BITCOUNT;
* Aggregate functions: BIT_AND, BIT_OR, BIT_XOR.
Note that this is a change in plan for BITCOUNT (CALCITE-3697 would call it
BIT_COUNT, but now we'll call it BITCOUNT) and BIT_NOT (CALCITE-3592 would call
it BIT_NOT, but now we'll call it BITNOT).
We can expose these under various synonyms in particular libaries, e.g.:
* In the MySQL variant we can expose BITCOUNT as BIT_COUNT.
* In the Snowflake variant we can expose BIT_AND as BITAND_AGG, similarly
BIT_OR and BIT_XOR.
* Et cetera.
[~hailong wang] If you agree please update CALCITE-3697 and CALCITE-3592.
> Implement bit functions and operators
> -------------------------------------
>
> Key: CALCITE-3732
> URL: https://issues.apache.org/jira/browse/CALCITE-3732
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.21.0
> Reporter: hailong wang
> Assignee: hailong wang
> Priority: Major
> Fix For: 1.22.0
>
>
> Bit function is non-standard operators, but all db has implemented, such as
> mysql, postgresql.
> Calcite has implemented BIT_AND, BIT_OR in
> https://issues.apache.org/jira/browse/CALCITE-2770, BIT_XOR in
> https://issues.apache.org/jira/browse/CALCITE-3591. BIT_COUNT is in progress
> https://issues.apache.org/jira/browse/CALCITE-3697, BIT_NOT(~) is in progress
> https://issues.apache.org/jira/browse/CALCITE-3592.
> So I think we should also implement Bitwise AND(&), Right shift(>>), Left
> shift(<<), Bitwise XOR(^), Bitwise OR(|). And data types support tinyint,
> smallint, int, bigint like before.
>
> Refence:
> [https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_bitwise-invert]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)