Skip to content

Conversation

@szehon-ho
Copy link
Member

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.

@szehon-ho
Copy link
Member Author

FYI @RussellSpitzer @aokolnychyi if you guys have some cycles, thanks

Comment on lines 156 to 158
return Sets.newHashSet(MetadataTableType.ALL_DATA_FILES,
MetadataTableType.ALL_DATA_FILES,
MetadataTableType.ALL_FILES)
Copy link
Contributor

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.

Copy link
Contributor

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) {
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about isAggFileTable?

@aokolnychyi
Copy link
Contributor

Let me take a look at this one as well.

Copy link
Contributor

@aokolnychyi aokolnychyi left a 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.
Copy link
Contributor

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?

Copy link
Member Author

@szehon-ho szehon-ho May 5, 2022

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: should be AllDeleteFilesTableScan

Copy link
Member Author

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.
Copy link
Contributor

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 {
Copy link
Contributor

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.

Comment on lines 156 to 158
return Sets.newHashSet(MetadataTableType.ALL_DATA_FILES,
MetadataTableType.ALL_DATA_FILES,
MetadataTableType.ALL_FILES)
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about isAggFileTable?

@szehon-ho szehon-ho merged commit 8896316 into apache:master May 6, 2022
@szehon-ho
Copy link
Member Author

Thanks @aokolnychyi and @kbendick for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants