shinzoxD commented on issue #12342:
URL: https://github.com/apache/datafusion/issues/12342#issuecomment-5304604530

   I checked this on current `main` (`e7e037d`).
   
   The original planning error is gone. Date32/Date64 `+`/`-` integer is 
treated as a number of days (Postgres-compatible), including the commutative 
`integer + date` form:
   
   ```sql
   SELECT to_date('1970-01-01') + 5;
   -- 1970-01-06
   
   SELECT '1970-01-01'::date + 5;
   -- 1970-01-06
   ```
   
   This was added in #19460 (`arith_date_integer.slt` and the 
`temporal_math_coercion` Date+Int → Date+Interval path).
   
   One caveat on the exact issue query: `to_date('1970-01-01', 'yyyy-mm-dd')` 
still fails because DataFusion uses Chrono strftime patterns (`%Y-%m-%d`), not 
Oracle/`yyyy-mm-dd`. That is independent of the Date32+Int64 coercion bug. 
`to_date('1970-01-01') + 5` and `to_date('1970-01-01', '%Y-%m-%d') + 5` both 
work.
   
   I think this can be closed as fixed by #19460, as @Omega359 noted.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to