You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "phillipleblanc (via GitHub)" <gi...@apache.org> on 2025/02/04 17:11:54 UTC
[I] Support casting strings to Date32 that contain large dates [arrow-rs]
phillipleblanc opened a new issue, #7073:
URL: https://github.com/apache/arrow-rs/issues/7073
**Describe the bug**
Attempting to convert a string which contains a valid large date in the ISO format (i.e. `+10999-12-31`) will result in the following error:
`CastError("Cannot cast string '+10999-12-31' to value of Date32 type")`
According to ISO 8601:
> Four digits or more for the year. Years in the range 0000 to 9999 will be pre-padded by zero to ensure four digits. Years outside that range will have a prefixed positive or negative symbol.
**To Reproduce**
```rust
#[test]
fn test_cast_string_with_large_date_to_date32() {
let array = Arc::new(StringArray::from(vec![
Some("+10999-12-31"),
Some("-0010-02-28")
])) as ArrayRef;
let to_type = DataType::Date32;
let options = CastOptions {
safe: false,
format_options: FormatOptions::default(),
};
let b = cast_with_options(&array, &to_type, &options).unwrap();
let c = b.as_primitive::<Date32Type>();
assert_eq!(3298139, c.value(0));
assert_eq!(-723122, c.value(1));
}
```
**Expected behavior**
The cast works as expected.
--
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] Support casting strings to Date32 that contain large dates [arrow-rs]
Posted by "phillipleblanc (via GitHub)" <gi...@apache.org>.
phillipleblanc commented on issue #7073:
URL: https://github.com/apache/arrow-rs/issues/7073#issuecomment-2634612370
take
--
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] Support casting strings to Date32 that contain large dates [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #7073: Support casting strings to Date32 that contain large dates
URL: https://github.com/apache/arrow-rs/issues/7073
--
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] Support casting strings to Date32 that contain large dates [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #7073:
URL: https://github.com/apache/arrow-rs/issues/7073#issuecomment-2653991684
`label_issue.py` automatically added labels {'object-store'} from #7076
--
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] Support casting strings to Date32 that contain large dates [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #7073:
URL: https://github.com/apache/arrow-rs/issues/7073#issuecomment-2653991291
`label_issue.py` automatically added labels {'arrow'} from #7076
--
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] Support casting strings to Date32 that contain large dates [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #7073:
URL: https://github.com/apache/arrow-rs/issues/7073#issuecomment-2741680257
Migrating from arrow-rs issue [#7073](https://github.com/apache/arrow-rs/issues/7073)
--
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