-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Improve listing performance of Hudi tables #17084
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -384,29 +384,33 @@ static boolean shouldUseRecordReaderFromInputFormat(Configuration configuration, | |
| .anyMatch(USE_RECORD_READER_FROM_INPUT_FORMAT_ANNOTATION::equals); | ||
| } | ||
|
|
||
| static boolean shouldUseFileSplitsFromInputFormat(InputFormat<?, ?> inputFormat, Configuration conf, String tablePath) | ||
| static boolean shouldUseFileSplitsFromInputFormat(InputFormat<?, ?> inputFormat, DirectoryLister directoryLister) | ||
| { | ||
| boolean hasUseSplitsAnnotation = Arrays.stream(inputFormat.getClass().getAnnotations()) | ||
| .map(Annotation::annotationType) | ||
| .map(Class::getSimpleName) | ||
| .anyMatch(USE_FILE_SPLITS_FROM_INPUT_FORMAT_ANNOTATION::equals); | ||
| if (directoryLister instanceof HudiDirectoryLister) { | ||
| boolean hasUseSplitsAnnotation = Arrays.stream(inputFormat.getClass().getAnnotations()) | ||
| .map(Annotation::annotationType) | ||
| .map(Class::getSimpleName) | ||
| .anyMatch(USE_FILE_SPLITS_FROM_INPUT_FORMAT_ANNOTATION::equals); | ||
|
|
||
| return hasUseSplitsAnnotation && | ||
| (!isHudiParquetInputFormat(inputFormat) || shouldUseFileSplitsForHudi(inputFormat, ((HudiDirectoryLister) directoryLister).getMetaClient())); | ||
| } | ||
|
|
||
| return hasUseSplitsAnnotation && (!isHudiParquetInputFormat(inputFormat) || shouldUseFileSplitsForHudi(inputFormat, conf, tablePath)); | ||
| return false; | ||
| } | ||
|
|
||
| static boolean isHudiParquetInputFormat(InputFormat<?, ?> inputFormat) | ||
| { | ||
| return inputFormat instanceof HoodieParquetInputFormat; | ||
| } | ||
|
|
||
| private static boolean shouldUseFileSplitsForHudi(InputFormat<?, ?> inputFormat, Configuration conf, String tablePath) | ||
| private static boolean shouldUseFileSplitsForHudi(InputFormat<?, ?> inputFormat, HoodieTableMetaClient metaClient) | ||
| { | ||
| if (inputFormat instanceof HoodieParquetRealtimeInputFormat) { | ||
|
Collaborator
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. is n't this check same as
Contributor
Author
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.
|
||
| return true; | ||
| } | ||
|
|
||
| HoodieTableMetaClient hoodieTableMetaClient = HoodieTableMetaClient.builder().setConf(conf).setBasePath(tablePath).build(); | ||
| return hoodieTableMetaClient.getTableConfig().getBootstrapBasePath().isPresent(); | ||
| return metaClient.getTableConfig().getBootstrapBasePath().isPresent(); | ||
| } | ||
|
|
||
| public static long parseHiveDate(String value) | ||
|
|
||
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.
this needs to be called out in the PR summary?