alamb opened a new issue #1159:
URL: https://github.com/apache/arrow-datafusion/issues/1159


   **Describe the bug**
   I found this while working on 
https://github.com/apache/arrow-datafusion/pull/1153
   
   Trying to do a boolean operation with eq or != results in an error such as:
   
   ```
   ArrowError(ExternalError(Internal("Data type Boolean not supported for 
binary operation on dyn arrays")))
   ```
   
   **To Reproduce**
   
   ```shell
   echo "true" > /tmp/foo.csv
   echo "false" >> /tmp/foo.csv
   
   cargo run --bin datafusion-cli
   ```
   
   Then run SQL:
   ```sql
   CREATE EXTERNAL TABLE foo(x boolean)
   STORED AS CSV
   LOCATION '/tmp/foo.csv';
   
   > select * from foo;
   +-------+
   | x     |
   +-------+
   | true  |
   | false |
   +-------+
   2 rows in set. Query took 0.010 seconds.
   > select x != x from foo;
   ArrowError(ExternalError(Internal("Data type Boolean not supported for 
binary operation on dyn arrays")))
   ```
   
   **Expected behavior**
   Expect the query to run and the a result of two columns of false values
   
   **Additional context**
   The reason it is a problem for constant folding, is that there is special 
case code to handle constant `true != false` type expressions but it doesn't 
work with the general purpose constant evaluator.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to