-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: Add estimateRowCount for Files and Entries Metadata Tables #10759
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
core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java
Outdated
Show resolved
Hide resolved
2306f7c to
71d23c1
Compare
|
cc @amogh-jahagirdar @RussellSpitzer does it make sense? Thanks |
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.
@szehon-ho This was a great find, this improvement makes sense to me! I'll wait before merging in case @RussellSpitzer has any comments
core/src/test/java/org/apache/iceberg/TestMetadataTableScans.java
Outdated
Show resolved
Hide resolved
RussellSpitzer
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 good to me! Great find
|
Hi,May I ask why we are not using |
|
This is for a metadata table and not data table. Hence for manifest-read task, each manifest's row count is the number of files it references (added + deleted + existing) |
Got it, thank you for your answer |
Spark queries of Metadata Tables will often try to check row count estimates repeatedly during planning phase, like picking a join strategy.
By default, this involves an extra call to read the manifest file header, as the default logic on the BaseContentScanTask is as follows:
However, we actually have this information in the metadata and can just return it directly without reading the file header.
This can save many calls on the Spark driver for planning (one call per manifest file, so potentially many thousands, in serial manner).
This is useful as many Spark maintenance procedures involve querying these tables ( expireSnapshots, removeOrphanFiles)