Skip to content

Commit ea33b3d

Browse files
friendlymatthewadriangbclaude
committed
coerce Union vs scalar in comparisons (apache#22825)
- Closes apache#18825 Add a `union_coercion` rule so that comparisons between a Union column and an opaque scalar pick the scalar type whenever any union variant can be cast to it. The execution side is already handled by arrow-rs's `cast(Union -> T)` (arrow 58.3.0+), which extracts values from the matching variant and emits NULL for rows whose active variant is not castable to the target --------- Co-authored-by: Adrian Garcia Badaracco <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 45d943d commit ea33b3d

3 files changed

Lines changed: 529 additions & 0 deletions

File tree

‎datafusion/core/tests/sql/mod.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ mod path_partition;
7070
mod runtime_config;
7171
pub mod select;
7272
mod sql_api;
73+
mod union_comparison;
7374
mod unparser;
7475

7576
async fn register_aggregate_csv_by_sql(ctx: &SessionContext) {

0 commit comments

Comments
 (0)