You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "spaydar (via GitHub)" <gi...@apache.org> on 2023/08/10 05:56:33 UTC

[GitHub] [arrow-datafusion] spaydar opened a new issue, #7255: Bitwise XOR operator is inconsistent in CLI

spaydar opened a new issue, #7255:
URL: https://github.com/apache/arrow-datafusion/issues/7255

   ### Describe the bug
   
   The [implementation of the `Display` trait for the bitwise XOR operator](https://github.com/apache/arrow-datafusion/blob/71be0fcce04c137b899e9cc00dc121ca2cf51013/datafusion/expr/src/operator.rs#L256) writes `#` (SQL Bitwise XOR), but the CLI only accepts `^` (Rust Bitwise XOR) to perform this operation.
   
   Encountered while writing Operators documentation.
   
   ### To Reproduce
   
   In DataFusion CLI v28.0.0, enter the following:
   ```sql
   -- SQL Bitwise XOR (#) not accepted
   ❯ SELECT 5 # 3;
   ❯ SELECT 5 # 3;  🤔 Invalid statement: sql parser error: Expected end of statement, found: 3
   
   -- Rust Bitwise XOR (^) accepted as input, but SQL Bitwise XOR (#) is displayed in output
   ❯ SELECT 5 ^ 3;
   +---------------------+                
   | Int64(5) # Int64(3) |                
   +---------------------+                                                                     
   | 6                   |                                                     
   +---------------------+                           
   1 row in set. Query took 0.001 seconds.
   
   -- SQL Bitwise XOR (#) is accepted as a unary operator
   ❯ SELECT 5 #;
   +---+                                                                       
   | # |                                                                                       
   +---+                                  
   | 5 |                                                                                       
   +---+                                  
   1 row in set. Query took 0.001 seconds.
   ```
   
   ### Expected behavior
   
   SQL Bitwise Operator `#` should be accepted as input and displayed in CLI and Rust Bitwise Operator `^` should not
   ```sql
   ❯ SELECT 5 # 3;
   +---------------------+                
   | Int64(5) # Int64(3) |                
   +---------------------+                                                                     
   | 6                   |                                                     
   +---------------------+                           
   1 row in set. Query took 0.001 seconds.
   ```
   
   ### Additional context
   
   _No response_


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb closed issue #7255: Bitwise XOR operator is inconsistent in CLI

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #7255: Bitwise XOR operator is inconsistent in CLI
URL: https://github.com/apache/arrow-datafusion/issues/7255


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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org