-
Notifications
You must be signed in to change notification settings - Fork 78
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
Optimizations in parquet file page materialization #5582
Conversation
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.
Python LGTM
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.
Very nice change set. Meaningfully reduces allocation. Want to consider if there's a way to make BigDecimal better.
replication/static/src/main/java/io/deephaven/replicators/ReplicatePageMaterializers.java
Outdated
Show resolved
Hide resolved
extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PageMaterializer.java
Outdated
Show resolved
Hide resolved
extensions/parquet/base/src/main/java/io/deephaven/parquet/base/PageMaterializer.java
Outdated
Show resolved
Hide resolved
...uet/base/src/main/java/io/deephaven/parquet/base/materializers/LongPageMaterializerBase.java
Outdated
Show resolved
Hide resolved
...base/src/main/java/io/deephaven/parquet/base/materializers/InstantFromInt96Materializer.java
Outdated
Show resolved
Hide resolved
...base/src/main/java/io/deephaven/parquet/base/materializers/InstantFromInt96Materializer.java
Outdated
Show resolved
Hide resolved
|
||
@Override | ||
@NotNull | ||
public final Class<LocalDate> getNativeType() { |
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 makes me wonder if we should just have a ToObjectPage
with a type field. Then again, here we can use a singleton, which is nice. Maybe ignore me.
...ase/src/main/java/io/deephaven/parquet/base/materializers/LocalTimePageMaterializerBase.java
Outdated
Show resolved
Hide resolved
...et/base/src/main/java/io/deephaven/parquet/base/materializers/LocalDateTimeMaterializer.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/deephaven/parquet/base/materializers/LocalDateTimeFromNanosMaterializer.java
Outdated
Show resolved
Hide resolved
...rc/main/java/io/deephaven/parquet/base/materializers/LocalDateTimeFromNanosMaterializer.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.
Reviewed. I'm happy to merge these changes, or hold out for BigDecimal, etc.
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.
Let's merge this, and make a separate PR for BigDecimal.
In the original code, for non-primitive types like non-dictionary encoded Strings, LocalDate, etc., we read the bytes from the parquet file and convert it to binary data, and then later we convert the binary data to appropriate type, like String. This leads to extra memory allocation and extra copy for each value. After this PR, we will go directly from parquet file -> String in one step and that saves up to 10% in performance and significant improvements in memory utilization.
Same optimization has also been done for a few primitive types like char, short, and byte. For these types, we originally did parquet data -> int and int -> short/char/byte. Now we do directly parquet file -> short/char/byte