You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/01/11 04:11:40 UTC

[GitHub] [calcite] XuQianJin-Stars opened a new pull request #1746: [CALCITE-3697] Implement bit_count function

XuQianJin-Stars opened a new pull request #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746
 
 
   As illustrated in [CALCITE-3697](https://issues.apache.org/jira/browse/CALCITE-3697)
   select bit_count(8);
   +--------+
   | EXPR$0 |
   +--------+
   |      1        |
   +--------+
   (1 row)
   
   !ok

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] ritesh-kapoor commented on issue #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
ritesh-kapoor commented on issue #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#issuecomment-573443997
 
 
   Looks great 👍 

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] XuQianJin-Stars commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
XuQianJin-Stars commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#discussion_r365652756
 
 

 ##########
 File path: site/_docs/reference.md
 ##########
 @@ -2294,6 +2294,7 @@ semantics.
 | C | Operator syntax                                | Description
 |:- |:-----------------------------------------------|:-----------
 | p | expr :: type                                   | Casts *expr* to *type*
+| m | BIT_COUNT(integer)                             | Returns the bitwise COUNT of non-null *integer*
 
 Review comment:
   > How about the `null` input, i.e., `bit_count(null)`? I think we'd better add some tests and update the doc as that of `BIT_XOR`.
   
   Need to add this as a null test? Because `defineMethod (BIT_COUNT, BuiltInMethod.BIT_COUNT.method, NullPolicy.STRICT); `are strictly defined and cannot be null.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] XuQianJin-Stars commented on issue #1746: [CALCITE-3697] Implement BITCOUNT function

Posted by GitBox <gi...@apache.org>.
XuQianJin-Stars commented on issue #1746: [CALCITE-3697] Implement BITCOUNT function
URL: https://github.com/apache/calcite/pull/1746#issuecomment-599303991
 
 
   > As Julian's comment in this JIRA, any consensuses on the function's name? I can see a discussion in [CALCITE-3732](https://issues.apache.org/jira/browse/CALCITE-3732).
   
   Let me change 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] XuQianJin-Stars commented on issue #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
XuQianJin-Stars commented on issue #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#issuecomment-599213305
 
 
   hi @DonnyZone This PR is OK?

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] hsyuan commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
hsyuan commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#discussion_r365660183
 
 

 ##########
 File path: site/_docs/reference.md
 ##########
 @@ -2294,6 +2294,7 @@ semantics.
 | C | Operator syntax                                | Description
 |:- |:-----------------------------------------------|:-----------
 | p | expr :: type                                   | Casts *expr* to *type*
+| m | BIT_COUNT(integer)                             | Returns the bitwise COUNT of non-null *integer*
 
 Review comment:
   +1 on what @DonnyZone said.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] DonnyZone commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
DonnyZone commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#discussion_r365655863
 
 

 ##########
 File path: site/_docs/reference.md
 ##########
 @@ -2294,6 +2294,7 @@ semantics.
 | C | Operator syntax                                | Description
 |:- |:-----------------------------------------------|:-----------
 | p | expr :: type                                   | Casts *expr* to *type*
+| m | BIT_COUNT(integer)                             | Returns the bitwise COUNT of non-null *integer*
 
 Review comment:
   `NullPolicy.Strict` prevents the function call when one input is `null` and directly returns `null`. 
   Therefore, I think we'd better tell end-users what he will get for `bit_count(col)` when `col` is `null`. 
   E.g.,
   > Returns the bitwise XOR of all non-null input values, or null if none

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] DonnyZone commented on issue #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
DonnyZone commented on issue #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#issuecomment-573521446
 
 
   It's just a minor suggestion.
   Yhis PR LGTM.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] DonnyZone commented on issue #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
DonnyZone commented on issue #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#issuecomment-599301053
 
 
   As Julian's comment in this JIRA, any consensuses on the function's name? I can see a discussion in [CALCITE-3732](https://issues.apache.org/jira/browse/CALCITE-3732).

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] DonnyZone edited a comment on issue #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
DonnyZone edited a comment on issue #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#issuecomment-573521446
 
 
   It's just a minor suggestion.
   This PR LGTM.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [calcite] DonnyZone commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function

Posted by GitBox <gi...@apache.org>.
DonnyZone commented on a change in pull request #1746: [CALCITE-3697] Implement bit_count function
URL: https://github.com/apache/calcite/pull/1746#discussion_r365651274
 
 

 ##########
 File path: site/_docs/reference.md
 ##########
 @@ -2294,6 +2294,7 @@ semantics.
 | C | Operator syntax                                | Description
 |:- |:-----------------------------------------------|:-----------
 | p | expr :: type                                   | Casts *expr* to *type*
+| m | BIT_COUNT(integer)                             | Returns the bitwise COUNT of non-null *integer*
 
 Review comment:
   How about the `null` input, i.e., `bit_count(null)`? I think we'd better add some tests and update the doc as that of `BIT_XOR`.

----------------------------------------------------------------
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


With regards,
Apache Git Services