fix: avoid panic in array_with_timezone on non-microsecond timestamp dictionaries #7781
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.35) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 166 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.306
Real PR Conversation Timeline
1 comments
"Review active on #7781"
general
weight: 0.35
sunchao
Summary
Unable to downcast to primitive array) when reading a top-levelDictionary(Int32, Timestamp(Millisecond, None))column asTimestamp(Microsecond, None)in the native Parquet schema adapter.native/spark-expr/src/utils.rs(array_with_timezone), replaces theas_dictionary_array::<Int32Type>+as_primitive_array::<TimestampMicrosecondType>downcast witharray.as_any_dictionary()and recurses directly ondict.values(), preserving any timestamp unit and dictionary key type.Some(DataType::Timestamp(_, None))pass-through in theDataType::Timestamp(_, None)arm ofarray_with_timezoneso Arrow'scast_with_optionscan perform the unit conversion afterward.native/spark-expr/src/utils.rsandnative/core/src/parquet/schema_adapter.rs(roundtripreproduction for7 ms -> 7_000 µsplus edge cases).Fixes #7747.
Test plan
test_array_with_timezone_dictionary_non_microsecond_timestampinnative/spark-expr/src/utils.rs.dictionary_timestamp_millis_unwrapped_to_microsanddictionary_timestamp_millis_unwrapped_to_micros_edge_casesinnative/core/src/parquet/schema_adapter.rs.cargo test,cargo clippy, andcargo fmt --check.