You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "shinzoxD (via GitHub)" <gi...@apache.org> on 2026/08/15 22:49:56 UTC

Re: [I] [BUG] Error when adding Date32 and Int64 [datafusion]

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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org