-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Avoid re-reading parquet footer for iceberg stats in writer #19090
Avoid re-reading parquet footer for iceberg stats in writer #19090
Conversation
lib/trino-parquet/src/main/java/io/trino/parquet/writer/ParquetWriter.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergParquetFileWriter.java
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public Metrics getMetrics() | ||
{ | ||
return fileMetrics(inputFile, metricsConfig); |
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.
Add a test for your improvement in io.trino.plugin.iceberg.TestIcebergMetadataFileOperations
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.
TestIcebergMetadataFileOperations seems to be specifically about metadata operations, this is a "DATA" operation.
There is code preventing assertions on DATA operations at
Line 633 in fe70595
.filter(operation -> operation.fileType() != DATA) |
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.
you're right. we can either broaden the test class coverage (rename class to match data operations too)
or add similar class, a copy
or abstain from testing
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'm skipping testing access count explicitly for now
373871e
to
6e641c5
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergParquetFileWriter.java
Show resolved
Hide resolved
6e641c5
to
cc242ab
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergParquetFileWriter.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergParquetFileWriter.java
Outdated
Show resolved
Hide resolved
lib/trino-parquet/src/main/java/io/trino/parquet/writer/ParquetWriter.java
Outdated
Show resolved
Hide resolved
lib/trino-parquet/src/main/java/io/trino/parquet/writer/ParquetWriter.java
Outdated
Show resolved
Hide resolved
lib/trino-parquet/src/main/java/io/trino/parquet/writer/ParquetWriter.java
Show resolved
Hide resolved
Composition is generally preferred over inheritance for reusing code
cc242ab
to
d3654e5
Compare
Currently we're reading parquet file footer back just after writing it to file system for computing iceberg stats. Since Trino parquet writer already has the file footer, there is no need to perform an extra IO to get the footer again.
d3654e5
to
5e4bee9
Compare
Description
Currently we're reading parquet file footer back just after
writing it to file system for computing iceberg stats.
Since Trino parquet writer already has the file footer, there
is no need to perform an extra IO to get the footer again.
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: