-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Core: Add all_delete_files and all_files tables #4694
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
Conversation
|
FYI @RussellSpitzer @aokolnychyi if you guys have some cycles, thanks |
| return Sets.newHashSet(MetadataTableType.ALL_DATA_FILES, | ||
| MetadataTableType.ALL_DATA_FILES, | ||
| MetadataTableType.ALL_FILES) |
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.
Nit: Consider making this a static final constant.
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.
+1 for a constant
| } | ||
| } | ||
|
|
||
| private boolean allFileTableTest(MetadataTableType tableType) { |
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.
Nit: This might read better as isAllFilesTable, though I recognize there is an AllFilesTable now.
Maybe isOneOfAllFilesType or isTableAggregatedFromAllSnapshots?
Given there will be an ALL_FILES table, I'm not sure of the best name to add for this but throwing those out there.
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.
What about isAggFileTable?
|
Let me take a look at this one as well. |
aokolnychyi
left a comment
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.
Looks correct to me. Spotted a few typos in names.
| import org.apache.iceberg.io.CloseableIterable; | ||
|
|
||
| /** | ||
| * A {@link Table} implementation that exposes a table's valid delete files as rows. |
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.
nit: redundant a before table's valid delete files?
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.
Hm, I'm not sure about if its redundant ( 'table' needs an article, right?). How about:
A table implementation that exposes its valid delete files as rows
| return MetadataTableType.ALL_DELETE_FILES; | ||
| } | ||
|
|
||
| public static class AllDataFilesTableScan extends BaseAllFilesTableScan { |
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.
Typo: should be AllDeleteFilesTableScan
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.
Ah good catch ..
| import org.apache.iceberg.io.CloseableIterable; | ||
|
|
||
| /** | ||
| * A {@link Table} implementation that exposes a table's valid files as rows. |
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.
nit: also redundant a
| return MetadataTableType.ALL_FILES; | ||
| } | ||
|
|
||
| public static class AllDataFilesTableScan extends BaseAllFilesTableScan { |
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.
Typo in the name as well.
| return Sets.newHashSet(MetadataTableType.ALL_DATA_FILES, | ||
| MetadataTableType.ALL_DATA_FILES, | ||
| MetadataTableType.ALL_FILES) |
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.
+1 for a constant
| } | ||
| } | ||
|
|
||
| private boolean allFileTableTest(MetadataTableType tableType) { |
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.
What about isAggFileTable?
|
Thanks @aokolnychyi and @kbendick for review |
This will be the final set of changes for #4139, adding the new metadata tables 'all_delete_files' and 'all_files' to include delete files.
This adds both in one change list as it's easier to write a unified test, although they can be split up if we prefer that.