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


   **Describe the bug**
   I can not write a query that uses  `between` in the select list of a sql 
query
   
   **To Reproduce**
   
   ```shell
   echo "1" > /tmp/foo.csv
   cargo run -p datafusion-cli
   ```
   
   ```sql
   CREATE EXTERNAL TABLE foo(x int)
   STORED AS CSV
   LOCATION '/tmp/foo.csv';
   ```
   
   ```sql
   > select 1 between 5 and 10;
   NotImplemented("Create name does not support logical expression Utf8(NULL) 
BETWEEN Int64(5) AND Utf8(NULL)")
   
   > select 1 between 5 and 10 from foo;
   NotImplemented("Create name does not support logical expression Int64(1) 
BETWEEN Int64(5) AND Int64(10)")
   ```
   
   **Expected behavior**
   I expect a single row `false` to be returned
   
   **Workaround**
   Use an alias:
   ```
   > select 1 between 5 and 10 as my_expr;
   +---------+
   | my_expr |
   +---------+
   | false   |
   +---------+
   1 row in set. Query took 0.002 seconds.
   > select 1 between 5 and 10 as my_expr from foo;
   +---------+
   | my_expr |
   +---------+
   | false   |
   +---------+
   1 row in set. Query took 0.011 seconds.
   ```
   
   
   **Additional context**
   Add any other context about the problem here.
   


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