EyobelG opened a new pull request, #7781: URL: https://github.com/apache/datafusion-comet/pull/7781
## Summary - Fixes a panic (`Unable to downcast to primitive array`) when reading a top-level `Dictionary(Int32, Timestamp(Millisecond, None))` column as `Timestamp(Microsecond, None)` in the native Parquet schema adapter. - In `native/spark-expr/src/utils.rs` (`array_with_timezone`), replaces the `as_dictionary_array::<Int32Type>` + `as_primitive_array::<TimestampMicrosecondType>` downcast with `array.as_any_dictionary()` and recurses directly on `dict.values()`, preserving any timestamp unit and dictionary key type. - Allows `Some(DataType::Timestamp(_, None))` pass-through in the `DataType::Timestamp(_, None)` arm of `array_with_timezone` so Arrow's `cast_with_options` can perform the unit conversion afterward. - Adds unit tests in `native/spark-expr/src/utils.rs` and `native/core/src/parquet/schema_adapter.rs` (`roundtrip` reproduction for `7 ms -> 7_000 µs` plus edge cases). Fixes #7747. ## Test plan - Added `test_array_with_timezone_dictionary_non_microsecond_timestamp` in `native/spark-expr/src/utils.rs`. - Added `dictionary_timestamp_millis_unwrapped_to_micros` and `dictionary_timestamp_millis_unwrapped_to_micros_edge_cases` in `native/core/src/parquet/schema_adapter.rs`. - No local Rust toolchain available in this environment — relying on CI to run `cargo test`, `cargo clippy`, and `cargo fmt --check`. -- 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]
