AlyAbdelmoneim opened a new pull request, #20253:
URL: https://github.com/apache/datafusion/pull/20253
## Which issue does this PR close?
- Part of #17498.
## Rationale for this change
Currently, invalid `coerce_int96` values (e.g., "invalid") are accepted at
`SET` time and only fail later when reading Parquet files. This PR adds early
validation so invalid values are rejected immediately with clear error
messages, following the same pattern as `DFWriterVersion`.
## What changes are included in this PR?
- Add `DFTimeUnit` enum with `FromStr`, `Display`, `ConfigField`
implementations
- Change `ParquetOptions.coerce_int96` from `String`/`Option<String>` to
`Option<DFTimeUnit>`
- Remove `parse_coerce_int96_string` as a separate runtime parser;
validation now happens at config time
- Update proto conversions to validate during deserialization
- Update `ParquetFormat::with_coerce_int96` and related usage to accept
`Option<DFTimeUnit>`
- Add test for early validation
## Are these changes tested?
Yes. Added `test_parquet_coerce_int96_validation` that verifies:
- Valid values ("ns", "us", "ms", "s") are accepted
- Invalid values ("invalid") are rejected immediately at SET time
- Error messages are clear and helpful
## Are there any user-facing changes?
Not exactly. Invalid `coerce_int96` values now error immediately when set
via `SET` command or proto deserialization, instead of failing later during
Parquet file reading. This provides better error messages and earlier feedback.
--
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]