-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HUDI-4465] Optimizing file-listing sequence of Metadata Table #6016
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
885619c
Replaced string paht w/ Hadoop's `Path` to avoid costly conversions i…
f2ad090
Avoid fetching `FileSystem.get` since it's unused;
a6c3130
Cache `DateFormatter`/`TimestampFormatter` to avoid loading these t/h…
c812871
Avoid re-instantiating `HoodieTableMetadata` twice w/in `BaseHoodieTa…
6c96323
Fixing compilation
a3945f2
Avoid creating costly Hadoop's `Path` object wherever possible, repla…
8bc2456
Fixing compilation
8e10cb8
Avoid loading defaults in Hadoop conf when init-ing HFile reader;
803facf
Short-circuit fetching partition path for non-partitioned tables (sim…
fcc7e95
Cleaned up `BaseTableMetadata`
51f27e6
Avoid looking up `FileSystem` for every partition when listing partit…
bfe5701
`lint`
045c526
Revert accidental change
350c16e
Reverting experimental changes
6508ce9
Fixing compilation (for Spark 2.4)
2ffe683
Make `CachingPath` non `Serializable`;
de08ca3
Fixed tests
f88229b
Fixed invalid cast in `HoodieTableMetaClient`
068a110
Fixing tests w/ invalid configuration
3db948f
Fixing more tests w/ invalid configuration
56d5176
Fixed configs in IT to properly mirror configs for DS cases
409066f
Tidying up
95ce817
Carve out exception for MT to avoid treating it as non-partitioned one
d448c74
Fixed `SimpleKeyGenerator` to assert that configured primary-key and
ea2c947
Fixed improperly configured test
8be611a
Fixed invalid partition-path configs in `TestHoodieDeltaStreamer` suite
46e53b5
Rebased `TimeTravelQuery` test to use Simple KG instead
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ | |
import java.nio.file.Paths; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Properties; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
|
@@ -98,8 +99,13 @@ public void testWriteDuringCompaction() throws IOException { | |
.withLayoutConfig(HoodieLayoutConfig.newBuilder() | ||
.withLayoutType(HoodieStorageLayout.LayoutType.BUCKET.name()) | ||
.withLayoutPartitioner(SparkBucketIndexPartitioner.class.getName()).build()) | ||
.withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(HoodieIndex.IndexType.BUCKET).withBucketNum("1").build()).build(); | ||
metaClient = getHoodieMetaClient(HoodieTableType.MERGE_ON_READ, config.getProps()); | ||
.withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(HoodieIndex.IndexType.BUCKET).withBucketNum("1").build()) | ||
.build(); | ||
|
||
Properties props = getPropertiesForKeyGen(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pass |
||
props.putAll(config.getProps()); | ||
|
||
metaClient = getHoodieMetaClient(HoodieTableType.MERGE_ON_READ, props); | ||
client = getHoodieWriteClient(config); | ||
|
||
// write data and commit | ||
|
@@ -138,8 +144,13 @@ public void testWriteLogDuringCompaction(boolean enableMetadataTable, boolean en | |
.withLayoutConfig(HoodieLayoutConfig.newBuilder() | ||
.withLayoutType(HoodieStorageLayout.LayoutType.BUCKET.name()) | ||
.withLayoutPartitioner(SparkBucketIndexPartitioner.class.getName()).build()) | ||
.withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(HoodieIndex.IndexType.BUCKET).withBucketNum("1").build()).build(); | ||
metaClient = getHoodieMetaClient(HoodieTableType.MERGE_ON_READ, config.getProps()); | ||
.withIndexConfig(HoodieIndexConfig.newBuilder().withIndexType(HoodieIndex.IndexType.BUCKET).withBucketNum("1").build()) | ||
.build(); | ||
|
||
Properties props = getPropertiesForKeyGen(true); | ||
props.putAll(config.getProps()); | ||
|
||
metaClient = getHoodieMetaClient(HoodieTableType.MERGE_ON_READ, props); | ||
client = getHoodieWriteClient(config); | ||
|
||
final List<HoodieRecord> records = dataGen.generateInserts("001", 100); | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the validation message be more user-friendly? Let's say
"Partition path field has to be non-empty! For non-partitioned table, set key generator class to NonPartitionedKeyGenerator"
.Also, why are these validations only added for SimpleKeyGenerator? Why not other keygens as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense to put suggestions into exception messages -- exception messages should be focused on the problem triggering it, rather than on potential to remedy it (empty partition-path field is usually a sign of misconfiguration, since there's no default value, meaning that user passes "" explicitly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
Should we add these validations to other keygens as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline. It will be taken up separately. @alexeykudinkin in case if you have a JIRA, please link it here. For simple keygen we need the validation because of misconfiguration of some tests that were passing “” as partition fields.