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
CREATE TABLE T (
dt STRING NOT NULL,
name STRING NOT NULL,
amount BIGINT
) PARTITIONED BY (dt);
-- create a branch for streaming job
CALL sys.create_branch('default.T', 'test');
-- set primary key and bucket number for the branch
ALTER TABLE `T$branch_test` SET (
'primary-key' = 'dt,name',
'bucket' = '2',
'changelog-producer' = 'lookup'
);
-- set fallback branch
ALTER TABLE T SET (
'scan.fallback-branch' = 'test'
);
-- write records into the streaming branch
INSERT INTO `T$branch_test` VALUES ('20240725', 'apple', 4), ('20240725', 'peach', 10), ('20240726', 'cherry', 3), ('20240726', 'pear', 6);
-- write records into the default branch
INSERT INTO T VALUES ('20240725', 'apple', 5), ('20240725', 'banana', 7);
SELECT * FROM T;
### What doesn't meet your expectations?
Expect union result from both T and T$branch_test, like the following:
/*
+------------------+------------------+--------+
| dt | name | amount |
+------------------+------------------+--------+
| 20240725 | apple | 5 |
| 20240725 | peach| 10|
| 20240725 | banana | 7 |
| 20240726 | cherry | 3 |
| 20240726 | pear | 6 |
+------------------+------------------+--------+
*/
But only got data from T,
/*
+------------------+------------------+--------+
| dt | name | amount |
+------------------+------------------+--------+
| 20240725 | apple | 5 |
| 20240725 | banana | 7 |
+------------------+------------------+--------+
*/
### Anything else?
Only got union result after fast-forward:
CALL sys.fast_forward('default.T', 'test');
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
The text was updated successfully, but these errors were encountered:
isn't that expected behaviour?
until you do a fast_forward the main branch T will be completely separate from T$branch_test and thus selecting from it will not show any union of the 2 separate branches.
It's Not Expected according to the document.
It should union the found partition with the fallback branch, that's the reason why invent fallback branch.
Search before asking
Paimon version
1.0-SNAPSHOT
Compute Engine
flink 1.18.1
Minimal reproduce step
Just as the steps described in doc
The text was updated successfully, but these errors were encountered: