You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "liyubin117 (via GitHub)" <gi...@apache.org> on 2025/04/09 07:24:40 UTC
[PR] [core] Fix reading `files` system table from tables that have changed current branch [paimon]
liyubin117 opened a new pull request, #5430:
URL: https://github.com/apache/paimon/pull/5430
… current branch
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
When reading from tables that have changed current branch, `FilesTalbe#createReader` uses schema regardless of current branch changes, we should fix it.
```
Flink SQL> create table branch_1(id int);
[INFO] Execute statement succeeded.
Flink SQL> call sys.create_branch('default.branch_1','stream');
+---------+
| result |
+---------+
| Success |
+---------+
1 row in set
Flink SQL> insert into branch_1$branch_stream values (12);
Job ID: 48ab1653880f57b5c4bb695fe74f6da2
Flink SQL> alter table branch_1 set ('branch'='stream');
[INFO] Execute statement succeeded.
Flink SQL> select * from branch_1$files;
[ERROR] Could not execute SQL statement. Reason:
java.io.FileNotFoundException: /Users/elvin.li/data/paimon/paimon1/default.db/branch_1/branch/branch-stream/schema/schema-1 (No such file or directory)
```
<!-- What is the purpose of the change -->
### Tests
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Fix reading `files` system table from tables that have changed current branch [paimon]
Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on code in PR #5430:
URL: https://github.com/apache/paimon/pull/5430#discussion_r2041318618
##########
paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/BranchSqlITCase.java:
##########
@@ -288,6 +288,21 @@ public void testBranchFastForward() throws Exception {
"Fast-forward from the current branch 'test' is not allowed.");
}
+ @Test
+ public void testBranchSystemTableRead() throws Exception {
+ sql(
+ "CREATE TABLE T ( pt INT NOT NULL, k INT NOT NULL, v STRING ) PARTITIONED BY (pt) WITH ( 'bucket' = '-1' )");
+ sql("CALL sys.create_branch('default.T', 'stream')");
+ sql(
+ "INSERT INTO T$branch_stream VALUES (1, 10, 'truck'), (1, 12, 'suv'), (2, 20, 'moto'), (2, 25, 'coupe')");
+ sql("alter table T set ('branch'='stream')");
Review Comment:
Got it~
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Fix reading `files` system table from tables that have changed current branch [paimon]
Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 closed pull request #5430: [core] Fix reading `files` system table from tables that have changed current branch
URL: https://github.com/apache/paimon/pull/5430
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Fix reading `files` system table from tables that have changed current branch [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #5430:
URL: https://github.com/apache/paimon/pull/5430#discussion_r2041310825
##########
paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/BranchSqlITCase.java:
##########
@@ -288,6 +288,21 @@ public void testBranchFastForward() throws Exception {
"Fast-forward from the current branch 'test' is not allowed.");
}
+ @Test
+ public void testBranchSystemTableRead() throws Exception {
+ sql(
+ "CREATE TABLE T ( pt INT NOT NULL, k INT NOT NULL, v STRING ) PARTITIONED BY (pt) WITH ( 'bucket' = '-1' )");
+ sql("CALL sys.create_branch('default.T', 'stream')");
+ sql(
+ "INSERT INTO T$branch_stream VALUES (1, 10, 'truck'), (1, 12, 'suv'), (2, 20, 'moto'), (2, 25, 'coupe')");
+ sql("alter table T set ('branch'='stream')");
Review Comment:
This is deprecated method, you should use `T$branch_stream$files` only.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Fix reading `files` system table from tables that have changed current branch [paimon]
Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on PR #5430:
URL: https://github.com/apache/paimon/pull/5430#issuecomment-2796612693
@JingsongLi CI passed, PTAL, thanks :)
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] Fix reading `files` system table from tables that have changed current branch [paimon]
Posted by "liyubin117 (via GitHub)" <gi...@apache.org>.
liyubin117 commented on PR #5430:
URL: https://github.com/apache/paimon/pull/5430#issuecomment-2789799935
CI failed caused by issues fixed by https://github.com/apache/paimon/pull/5435
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org