You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "adriangb (via GitHub)" <gi...@apache.org> on 2025/06/21 12:55:57 UTC

[I] Date64::to_naive_date panics on larger values [arrow-rs]

adriangb opened a new issue, #7728:
URL: https://github.com/apache/arrow-rs/issues/7728

   In DataFusion we found that this panics, despite the value being well within the range of an i64:
   
   ```rust
   Literal::new(ScalarValue::Date64(Some(-790179464505600000)))
   ```
   
   Internally it calls `Date64::to_naive_date(Some(-790179464505600000))` which ends up hitting this panic:
   
   https://github.com/chronotope/chrono/blob/bab97905ccfa5aa7ceae1ee131b41b7113ea4f6a/src/naive/date/mod.rs#L1876-L1877
   
   I believe we should call `NaiveDate::checked_add_signed` and propagate the opt everywhere.
   
   DataFusion will have to decide what it does with that.


-- 
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@arrow.apache.org.apache.org

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


Re: [I] Date64::to_naive_date panics on larger values [arrow-rs]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on issue #7728:
URL: https://github.com/apache/arrow-rs/issues/7728#issuecomment-4862760344

   - resolved by https://github.com/apache/arrow-rs/pull/7737


-- 
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@arrow.apache.org

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


Re: [I] Date64::to_naive_date panics on larger values [arrow-rs]

Posted by "liamzwbao (via GitHub)" <gi...@apache.org>.
liamzwbao commented on issue #7728:
URL: https://github.com/apache/arrow-rs/issues/7728#issuecomment-3085866297

   Hi @adriangb, just want to check if this is still needed. I found that we already support `to_naive_date_opt` in #7737 so I guess we can close this issue.


-- 
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@arrow.apache.org

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


Re: [I] Date64::to_naive_date panics on larger values [arrow-rs]

Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #7728: Date64::to_naive_date panics on larger values
URL: https://github.com/apache/arrow-rs/issues/7728


-- 
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@arrow.apache.org

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