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

   **Describe the bug**
   I am trying to run a query that adds an interval to a date as part of the 
where clause and it fails with a type coercion error.
   
   **To Reproduce**
   
   ``` rust
   #[tokio::test]
   async fn repro_date32_add_interval() -> Result<()> {
       let ctx = SessionContext::new();
       ctx.register_csv("t1", "tests/t1.csv", CsvReadOptions::default()).await?;
       let df = ctx.sql("SELECT * FROM t1 WHERE d_date between 
cast('2002-05-30' as date) and cast('2002-05-30' as date) + INTERVAL '60 
days'").await?;
       let plan = df.to_logical_plan();
       println!("{:?}", plan);
       Ok(())
   }
   ```
   
   **Expected behavior**
   I expect this query to run without error. Here is a similar query running in 
Postgres.
   
   ```
   postgres=# select * from test where a between cast('2022-04-12' as date) and 
cast('2022-04-12' as date) + INTERVAL '60 days';
                a              
   ----------------------------
    2022-04-13 20:29:35.879229
   (1 row)
   ```
   
   **Additional context**
   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.

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

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

Reply via email to