QuakeWang commented on code in PR #1271:
URL: https://github.com/apache/paimon-rust/pull/1271#discussion_r4438176805
##########
crates/integrations/datafusion/src/merge_into.rs:
##########
@@ -1538,15 +1538,20 @@ async fn build_source_partition_set(
ctx: &SQLContext,
table: &Table,
source_ref: &str,
- s_alias: &str,
- t_alias: &str,
+ s_alias: &Ident,
+ t_alias: &Ident,
on_expr: &SqlExpr,
) -> DFResult<Option<HashSet<Vec<u8>>>> {
let partition_keys = table.schema().partition_keys();
if partition_keys.is_empty() {
return Ok(None);
}
- 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,
Review 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.
--
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]