[hive] Support creating hive catalog table branch and reading branch data#3820
Merged
tsreaper merged 3 commits intoapache:masterfrom Aug 1, 2024
Merged
[hive] Support creating hive catalog table branch and reading branch data#3820tsreaper merged 3 commits intoapache:masterfrom
tsreaper merged 3 commits intoapache:masterfrom
Conversation
tsreaper
reviewed
Jul 29, 2024
Comment on lines
+203
to
+205
| if (!options.contains(CoreOptions.BRANCH)) { | ||
| options.set(CoreOptions.BRANCH, ""); | ||
| } |
Contributor
There was a problem hiding this comment.
NIT: Don't set default value here. Use different constructor of SchemaManager below.
| hiveShell.execute("SET paimon.branch=b2"); | ||
| assertThat(hiveShell.executeQuery("SELECT * FROM t")) | ||
| .isEqualTo(Arrays.asList("4\tx1", "5\tx2")); | ||
| hiveShell.execute("SET paimon.branch=null"); |
Contributor
There was a problem hiding this comment.
Test that after setting branch to null, we can read from default branch.
Comment on lines
+414
to
+423
| Path tableLocation = getDataTableLocation(identifier); | ||
| return new SchemaManager(fileIO, tableLocation, branchName) | ||
| .latest() | ||
| .map( | ||
| s -> { | ||
| Options branchOptions = new Options(s.options()); | ||
| branchOptions.set(CoreOptions.BRANCH, branchName); | ||
| return s.copy(branchOptions.toMap()); | ||
| }) | ||
| .orElseThrow(() -> new TableNotExistException(identifier)); |
Contributor
There was a problem hiding this comment.
Move this into tableSchemaInFileSystem, so that it supports reading schema for branches. FileSystemCatalog can also reuse this method.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Support creating hive catalog table branch and reading branch data
Tests
API and Format
No changes.
Documentation