Repository navigation
Conversation
|
Hi @JingsongLi, @QuakeWang Could you please review this PR when you have time? It fixes quoted alias handling in MERGE statements and adds regression tests. Thanks! |
| if !can_prune_target_by_source_partitions(partition_keys, t_alias, s_alias, on_expr) { | ||
| if !can_prune_target_by_source_partitions( | ||
| partition_keys, | ||
| &t_alias.value, |
There was a problem hiding this comment.
Non-blocking: could we retain Ident here and compare aliases using DataFusion’s identifier rules? The downstream eq_ignore_ascii_case conflates target "T" with source "t", treating "t".value = "t".value as a target/source partition equality. I reproduced this on a partitioned CoW table: pruning skips a matching target row, and MERGE inserts instead of updating it. It would be good to handle this here and add a regression test.
There was a problem hiding this comment.
Thanks for the review! I’ll preserve Ident in the partition-pruning checks, follow DataFusion’s identifier rules, and add a regression test for case-sensitive aliases.
Purpose
Linked issue: closes #1269
Fix MERGE statements failing with aliases containing spaces, reserved words, embedded quotes, or case-sensitive names.
Brief change log
Tests
API and Format
No.
Documentation
No.