You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] [spark] REPLACE TABLE with the deprecated spark.paimon.branch truncates main and writes 0 rows to the branch #11645
CREATETABLEt (id INT) USING paimon;
INSERT INTO t VALUES (1), (2);
CALL sys.create_branch(table =>'test.t', branch =>'b');
SETspark.paimon.branch = b;
REPLACE TABLE t ASSELECT*FROM`t$branch_main`;
What doesn't meet your expectations?
The statement succeeds without an error, and both t$branch_main and t$branch_b are empty. The replace truncated the main branch, and wrote into branch b the result of a query that read the main branch after the truncate.
With spark.paimon.branch set, SparkCatalog.loadSparkTable resolves the table to branch b, while replaceTable always targets the main branch. The self-reference check compares the relation with the main-branch identifier, and t$branch_main is not pinned, so the query reads main after the truncate.
Expected: reject the statement since load and replace disagree on the target, or reject spark.paimon.branch for RTAS. The option is deprecated (OptionUtils warns when it is used) and is not set by default, but the failure is silent.
Anything else?
Not a regression from #11452: the same statement behaves the same on master.
Activity