-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 materializing all results in Iceberg $files
system table at once
#16112
Avoid materializing all results in Iceberg $files
system table at once
#16112
Conversation
CC: @alexjo2144 | @findinpath |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Show resolved
Hide resolved
e81e50e
to
f1658ac
Compare
$files
system table at once
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
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 is definitely a better direction that the PageBuilder way
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IncrementalInMemoryRecordCursor.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
f1658ac
to
441c747
Compare
Thanks @alexjo2144 | @findinpath for reviewing the PR.
I hope we are going forward with this ( |
$files
system table at once$files
system table at once
Currently, we materialize all columns from the |
Like, If we query |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IncrementalInMemoryRecordCursor.java
Outdated
Show resolved
Hide resolved
441c747
to
7e02045
Compare
Addressed comments and rebased with master. |
core/trino-spi/src/main/java/io/trino/spi/connector/InMemoryRecordSet.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/CloseableInMemoryRecordCursor.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/CloseableInMemoryRecordCursor.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/CloseableInMemoryRecordCursor.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
Hi @ebyhr, When you get time, could you please take a look at this PR? |
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
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.
Just skimmed.
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
7e02045
to
7e1c6b1
Compare
Thanks, @ebyhr | @findinpath | @homar for the reviews. I have addressed the comments. |
7e1c6b1
to
71f693a
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/FilesTable.java
Outdated
Show resolved
Hide resolved
71f693a
to
b4b5d36
Compare
@@ -68,15 +68,15 @@ public RecordCursor cursor() | |||
return new InMemoryRecordCursor(types, records.iterator()); | |||
} | |||
|
|||
private static class InMemoryRecordCursor | |||
public static class InMemoryRecordCursor<T extends Iterator<? extends List<?>>> |
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.
The class became generic, but so there are now warnings wherever it's used as a raw class (eg 3 lines above).
BTW it seems the generics are not leveraged, since T shows up only in the constructor declaration.
#16295
Description
Fixes #15991
The RR is an alternative approach to fix #15991. another approach #16063 to fix #15991
For
iceberg.iceberg_small_files_tpcds_sf1000_parquet.store_sales$files
earlier it used to take 826MB of memory (~32K records loaded) and after the change, it takes 32.3 MB (~72K records loaded). It also reduces the response to console time by 50%.This example is when the table has ~227K files.
Before fix:

After fix:

Release notes
(X) Release notes are required, with the following suggested text: