-
Notifications
You must be signed in to change notification settings - Fork 5.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
Support Hudi merged view files for partition path updates without compaction #24283
Open
codope
wants to merge
2
commits into
prestodb:master
Choose a base branch
from
codope:hudi-hive-merged-view-part-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ public final class HiveSessionProperties | |
public static final String MAX_INITIAL_SPLITS = "max_initial_splits"; | ||
public static final String FILE_SPLITTABLE = "file_splittable"; | ||
private static final String HUDI_METADATA_ENABLED = "hudi_metadata_enabled"; | ||
private static final String HUDI_TABLES_USE_MERGED_VIEW = "hudi_tables_use_merged_view"; | ||
private static final String READ_TABLE_CONSTRAINTS = "read_table_constraints"; | ||
public static final String PARALLEL_PARSING_OF_PARTITION_VALUES_ENABLED = "parallel_parsing_of_partition_values_enabled"; | ||
public static final String QUICK_STATS_ENABLED = "quick_stats_enabled"; | ||
|
@@ -608,6 +609,11 @@ public HiveSessionProperties(HiveClientConfig hiveClientConfig, OrcFileWriterCon | |
"For Hudi tables prefer to fetch the list of file names, sizes and other metadata from the internal metadata table rather than storage", | ||
hiveClientConfig.isHudiMetadataEnabled(), | ||
false), | ||
stringProperty( | ||
HUDI_TABLES_USE_MERGED_VIEW, | ||
"For Hudi tables, use merged view to read data", | ||
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. please update the description here as well |
||
hiveClientConfig.getHudiTablesUseMergedView(), | ||
false), | ||
booleanProperty( | ||
PARALLEL_PARSING_OF_PARTITION_VALUES_ENABLED, | ||
"Enables parallel parsing of partition values from partition names using thread pool", | ||
|
@@ -1101,6 +1107,12 @@ public static boolean isHudiMetadataEnabled(ConnectorSession session) | |
return session.getProperty(HUDI_METADATA_ENABLED, Boolean.class); | ||
} | ||
|
||
public static String getHudiTablesUseMergedView(ConnectorSession session) | ||
{ | ||
String hudiTablesUseMergedView = session.getProperty(HUDI_TABLES_USE_MERGED_VIEW, String.class); | ||
return hudiTablesUseMergedView == null ? "" : hudiTablesUseMergedView; | ||
} | ||
|
||
public static boolean isReadTableConstraints(ConnectorSession session) | ||
{ | ||
return session.getProperty(READ_TABLE_CONSTRAINTS, Boolean.class); | ||
|
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
Binary file added
BIN
+24 Bytes
...o-hive/src/test/resources/hudi_mor_part_update/.hoodie/.19700101000000000.deltacommit.crc
Binary file not shown.
Binary file added
BIN
+16 Bytes
...c/test/resources/hudi_mor_part_update/.hoodie/.19700101000000000.deltacommit.inflight.crc
Binary file not shown.
Binary file added
BIN
+8 Bytes
.../test/resources/hudi_mor_part_update/.hoodie/.19700101000000000.deltacommit.requested.crc
Binary file not shown.
Binary file added
BIN
+24 Bytes
...o-hive/src/test/resources/hudi_mor_part_update/.hoodie/.19700101000005000.deltacommit.crc
Binary file not shown.
Binary file added
BIN
+20 Bytes
...c/test/resources/hudi_mor_part_update/.hoodie/.19700101000005000.deltacommit.inflight.crc
Binary file not shown.
Binary file added
BIN
+8 Bytes
.../test/resources/hudi_mor_part_update/.hoodie/.19700101000005000.deltacommit.requested.crc
Binary file not shown.
Binary file added
BIN
+32 Bytes
...o-hive/src/test/resources/hudi_mor_part_update/.hoodie/.19700101000006000.deltacommit.crc
Binary file not shown.
Binary file added
BIN
+28 Bytes
...c/test/resources/hudi_mor_part_update/.hoodie/.19700101000006000.deltacommit.inflight.crc
Binary file not shown.
Binary file added
BIN
+8 Bytes
.../test/resources/hudi_mor_part_update/.hoodie/.19700101000006000.deltacommit.requested.crc
Binary file not shown.
Binary file added
BIN
+24 Bytes
...o-hive/src/test/resources/hudi_mor_part_update/.hoodie/.19700101000007000.deltacommit.crc
Binary file not shown.
Binary file added
BIN
+20 Bytes
...c/test/resources/hudi_mor_part_update/.hoodie/.19700101000007000.deltacommit.inflight.crc
Binary file not shown.
Binary file added
BIN
+8 Bytes
.../test/resources/hudi_mor_part_update/.hoodie/.19700101000007000.deltacommit.requested.crc
Binary file not shown.
Binary file added
BIN
+24 Bytes
...o-hive/src/test/resources/hudi_mor_part_update/.hoodie/.19700101000008000.deltacommit.crc
Binary file not shown.
Binary file added
BIN
+20 Bytes
...c/test/resources/hudi_mor_part_update/.hoodie/.19700101000008000.deltacommit.inflight.crc
Binary file not shown.
Binary file added
BIN
+8 Bytes
.../test/resources/hudi_mor_part_update/.hoodie/.19700101000008000.deltacommit.requested.crc
Binary file not shown.
Binary file added
BIN
+32 Bytes
...o-hive/src/test/resources/hudi_mor_part_update/.hoodie/.19700101000009000.deltacommit.crc
Binary file not shown.
Binary file added
BIN
+28 Bytes
...c/test/resources/hudi_mor_part_update/.hoodie/.19700101000009000.deltacommit.inflight.crc
Binary file not shown.
Binary file added
BIN
+8 Bytes
.../test/resources/hudi_mor_part_update/.hoodie/.19700101000009000.deltacommit.requested.crc
Binary file not shown.
Binary file added
BIN
+16 Bytes
presto-hive/src/test/resources/hudi_mor_part_update/.hoodie/.hoodie.properties.crc
Binary file not shown.
38 changes: 38 additions & 0 deletions
38
presto-hive/src/test/resources/hudi_mor_part_update/.hoodie/19700101000000000.deltacommit
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"partitionToWriteStats" : { | ||
"p1" : [ { | ||
"fileId" : "c0bbff31-67b3-4660-99ba-d388b8bb8c3c-0", | ||
"path" : "p1/c0bbff31-67b3-4660-99ba-d388b8bb8c3c-0_0-32-192_19700101000000000.parquet", | ||
"cdcStats" : null, | ||
"prevCommit" : "null", | ||
"numWrites" : 4, | ||
"numDeletes" : 0, | ||
"numUpdateWrites" : 0, | ||
"numInserts" : 4, | ||
"totalWriteBytes" : 435904, | ||
"totalWriteErrors" : 0, | ||
"tempPath" : null, | ||
"partitionPath" : "p1", | ||
"totalLogRecords" : 0, | ||
"totalLogFilesCompacted" : 0, | ||
"totalLogSizeCompacted" : 0, | ||
"totalUpdatedRecordsCompacted" : 0, | ||
"totalLogBlocks" : 0, | ||
"totalCorruptLogBlock" : 0, | ||
"totalRollbackBlocks" : 0, | ||
"fileSizeInBytes" : 435904, | ||
"minEventTime" : null, | ||
"maxEventTime" : null, | ||
"runtimeStats" : { | ||
"totalScanTime" : 0, | ||
"totalUpsertTime" : 0, | ||
"totalCreateTime" : 1553 | ||
} | ||
} ] | ||
}, | ||
"compacted" : false, | ||
"extraMetadata" : { | ||
"schema" : "{\"type\":\"record\",\"name\":\"PayloadAdaptableRecord\",\"namespace\":\"hoodie\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"pt\",\"type\":\"string\"},{\"name\":\"ts\",\"type\":[\"null\",\"long\"],\"default\":null},{\"name\":\"Op\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"_change_operation_type\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"_hoodie_is_deleted\",\"type\":[\"null\",\"boolean\"],\"default\":null},{\"name\":\"_event_seq\",\"type\":[\"null\",\"long\"],\"default\":null},{\"name\":\"_event_lsn\",\"type\":[\"null\",\"long\"],\"default\":null}]}" | ||
}, | ||
"operationType" : "UPSERT" | ||
} |
32 changes: 32 additions & 0 deletions
32
...ve/src/test/resources/hudi_mor_part_update/.hoodie/19700101000000000.deltacommit.inflight
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"partitionToWriteStats" : { | ||
"p1" : [ { | ||
"fileId" : "", | ||
"path" : null, | ||
"cdcStats" : null, | ||
"prevCommit" : "null", | ||
"numWrites" : 0, | ||
"numDeletes" : 0, | ||
"numUpdateWrites" : 0, | ||
"numInserts" : 4, | ||
"totalWriteBytes" : 0, | ||
"totalWriteErrors" : 0, | ||
"tempPath" : null, | ||
"partitionPath" : null, | ||
"totalLogRecords" : 0, | ||
"totalLogFilesCompacted" : 0, | ||
"totalLogSizeCompacted" : 0, | ||
"totalUpdatedRecordsCompacted" : 0, | ||
"totalLogBlocks" : 0, | ||
"totalCorruptLogBlock" : 0, | ||
"totalRollbackBlocks" : 0, | ||
"fileSizeInBytes" : 0, | ||
"minEventTime" : null, | ||
"maxEventTime" : null, | ||
"runtimeStats" : null | ||
} ] | ||
}, | ||
"compacted" : false, | ||
"extraMetadata" : { }, | ||
"operationType" : "UPSERT" | ||
} |
Empty file.
45 changes: 45 additions & 0 deletions
45
presto-hive/src/test/resources/hudi_mor_part_update/.hoodie/19700101000005000.deltacommit
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"partitionToWriteStats" : { | ||
"p1" : [ { | ||
"fileId" : "c0bbff31-67b3-4660-99ba-d388b8bb8c3c-0", | ||
"path" : "p1/.c0bbff31-67b3-4660-99ba-d388b8bb8c3c-0_19700101000000000.log.1_0-86-264", | ||
"cdcStats" : null, | ||
"prevCommit" : "19700101000000000", | ||
"numWrites" : 4, | ||
"numDeletes" : 0, | ||
"numUpdateWrites" : 4, | ||
"numInserts" : 0, | ||
"totalWriteBytes" : 1413, | ||
"totalWriteErrors" : 0, | ||
"tempPath" : null, | ||
"partitionPath" : "p1", | ||
"totalLogRecords" : 0, | ||
"totalLogFilesCompacted" : 0, | ||
"totalLogSizeCompacted" : 0, | ||
"totalUpdatedRecordsCompacted" : 0, | ||
"totalLogBlocks" : 0, | ||
"totalCorruptLogBlock" : 0, | ||
"totalRollbackBlocks" : 0, | ||
"fileSizeInBytes" : 1413, | ||
"minEventTime" : null, | ||
"maxEventTime" : null, | ||
"runtimeStats" : { | ||
"totalScanTime" : 0, | ||
"totalUpsertTime" : 109, | ||
"totalCreateTime" : 0 | ||
}, | ||
"logVersion" : 1, | ||
"logOffset" : 0, | ||
"baseFile" : "c0bbff31-67b3-4660-99ba-d388b8bb8c3c-0_0-32-192_19700101000000000.parquet", | ||
"logFiles" : [ ".c0bbff31-67b3-4660-99ba-d388b8bb8c3c-0_19700101000000000.log.1_0-86-264" ], | ||
"recordsStats" : { | ||
"val" : null | ||
} | ||
} ] | ||
}, | ||
"compacted" : false, | ||
"extraMetadata" : { | ||
"schema" : "{\"type\":\"record\",\"name\":\"PayloadAdaptableRecord\",\"namespace\":\"hoodie\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"pt\",\"type\":\"string\"},{\"name\":\"ts\",\"type\":[\"null\",\"long\"],\"default\":null},{\"name\":\"Op\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"_change_operation_type\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"_hoodie_is_deleted\",\"type\":[\"null\",\"boolean\"],\"default\":null},{\"name\":\"_event_seq\",\"type\":[\"null\",\"long\"],\"default\":null},{\"name\":\"_event_lsn\",\"type\":[\"null\",\"long\"],\"default\":null}]}" | ||
}, | ||
"operationType" : "UPSERT" | ||
} |
Oops, something went wrong.
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.
I think the description should be more clear about the type of value it's looking for. The type is a string, so for users it should be more explicit what the value should be. When I read this I initially thought it should be a boolean.
Based on looking at the tests it looks like it needs a dot-separated name of schema and table? If so, it should be clear about which tables should be added here