Skip to content

Commit

Permalink
[fix](cloud) fix strict mode invalidation when copy.use_delete_sign i…
Browse files Browse the repository at this point in the history
…s true for copy into (apache#37650)

Fix strict mode invalidation when copy.use_delete_sign is true for copy
into

Co-authored-by: Xin Liao <liaoxinbit@126.com>
  • Loading branch information
sollhui and liaoxin01 committed Jul 13, 2024
1 parent bd05cba commit 5aee624
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,16 @@ public void analyze(String fullDbName, TableName tableName, boolean useDeleteSig
}
} else {
for (int i = 0; i < targetColumns.size(); i++) {
BinaryPredicate binaryPredicate = new BinaryPredicate(Operator.EQ,
new SlotRef(null, targetColumns.get(i)),
new SlotRef(null, fileColumns.get(i)));
columnMappingList.add(binaryPredicate);
// If file column name equals target column name, don't need to add to
// columnMapping List. Otherwise it will result in invalidation of strict
// mode. Because if the src data is an expr, strict mode judgment will
// not be performed.
if (!fileColumns.get(i).equalsIgnoreCase(targetColumns.get(i))) {
BinaryPredicate binaryPredicate = new BinaryPredicate(Operator.EQ,
new SlotRef(null, targetColumns.get(i)),
new SlotRef(null, fileColumns.get(i)));
columnMappingList.add(binaryPredicate);
}
}
}
}
Expand Down

0 comments on commit 5aee624

Please sign in to comment.