[PARQUET-99] Page size check properties - #250
Conversation
|
@rdblue could you do a quick review of this? I think you were most recently in this path for the padding feature. I've actually had confirmation from another company that this fixed their OOM issues, so we're not the only ones affected. |
|
@danielcweeks, I'll have a look at it today. |
There was a problem hiding this comment.
Why are there only changes to ColumnWriteStoreV1 or ColumnWriterV1? Does V2 not need to be changed?
There was a problem hiding this comment.
I'll take a look at the v2 path. It's changed from the v1 path and I'm not sure if the logic is the same.
|
We were seeing this issue with very wide columns of text. While writing the parquet to disk, the writer would run out of memory. Once we applied this patch to v1.8.1, the memory issues were a thing of the past. |
|
I met https://issues.apache.org/jira/browse/PARQUET-99. |
|
@phoenixhadoop I'm working on rebasing this to master now. Hopefully it will make the next release. |
|
@rdblue I've updated the pull request to include both v1 and v2 writers. This new approach preserves the behavior of both readers by default and exposes the ability for you to set values for min and max row counts for page size checking (v1 only supports min as initial when estimate is disabled). |
|
Thanks! I'll take a look. |
There was a problem hiding this comment.
I think this should be minRowCountForPageSizeCheck. It looks like the name is wrong, but the value passed in by ParquetProperties is the min.
There was a problem hiding this comment.
Good catch. Actually, it should be "initial" for the sig. The issue is that v1 writer doesn't enforce a min or max and I wanted to maintain the same behavior. So v1 will use "min" as "initial" and v2 will support "min/max".
I'll fix the name.
There was a problem hiding this comment.
Nit: the rest of the codebase puts a space between if and the left paren.
|
I really like how this uses It's based on a previous version that doesn't have this morning's fixes. What do you think? |
There was a problem hiding this comment.
This looks good to me now.
Nit: the comments aren't needed and reference values no longer used. Maybe just change the "will check again halfway" by adding " if it is between min and max"
|
overall this looks good to me. |
|
I merged this in #297. Thanks for fixing this, Dan! |
This adds properties to set the min and max number of records that are passed between page checks, as well as a property that controls whether the next check will be based on records already seen or set to the minimum number of records between checks. * `parquet.page.size.row.check.min` - minimum number of records between page size checks * `parquet.page.size.row.check.max` - maximum number of records between page size checks * `parquet.page.size.check.estimate` - whether to estimate the number of records before the next check, or to always use the minimum number of records. This also updates the internal API to use ParquetProperties to carry encoding settings (used in parquet-column) to reduce the number of parameters passed through internal APIs. It also adds a builder for ParquetProperties to avoid needing to reference defaults in other modules. This closes apache#250 Author: Daniel Weeks <dweeks@netflix.com> Author: Ryan Blue <blue@apache.org> Closes apache#297 from rdblue/parquet-properties-update and squashes the following commits: c93b73e [Ryan Blue] PARQUET-99: Use ParquetProperties to carry encoding config. 18f8d3a [Daniel Weeks] Spacing 2090719 [Daniel Weeks] Update sizeCheck to write page properly if estimating is turned off 71336ee [Daniel Weeks] Fixed param name 5d99072 [Daniel Weeks] Update page size checking for v2 writer 3f7870c [Daniel Weeks] Rebase to resolve byte buffer conflicts 68794f0 [Daniel Weeks] Merge branch 'master' into page_size_check b49f03c [Daniel Weeks] Fixed reset of nextSizeCheck a057f46 [Daniel Weeks] Fixed inverted property logic e7cd54b [Daniel Weeks] Added property to toggle page size check estimation and initial row size checking
This adds properties to set the min and max number of records that are passed between page checks, as well as a property that controls whether the next check will be based on records already seen or set to the minimum number of records between checks. * `parquet.page.size.row.check.min` - minimum number of records between page size checks * `parquet.page.size.row.check.max` - maximum number of records between page size checks * `parquet.page.size.check.estimate` - whether to estimate the number of records before the next check, or to always use the minimum number of records. This also updates the internal API to use ParquetProperties to carry encoding settings (used in parquet-column) to reduce the number of parameters passed through internal APIs. It also adds a builder for ParquetProperties to avoid needing to reference defaults in other modules. This closes apache#250 Author: Daniel Weeks <dweeks@netflix.com> Author: Ryan Blue <blue@apache.org> Closes apache#297 from rdblue/parquet-properties-update and squashes the following commits: c93b73e [Ryan Blue] PARQUET-99: Use ParquetProperties to carry encoding config. 18f8d3a [Daniel Weeks] Spacing 2090719 [Daniel Weeks] Update sizeCheck to write page properly if estimating is turned off 71336ee [Daniel Weeks] Fixed param name 5d99072 [Daniel Weeks] Update page size checking for v2 writer 3f7870c [Daniel Weeks] Rebase to resolve byte buffer conflicts 68794f0 [Daniel Weeks] Merge branch 'master' into page_size_check b49f03c [Daniel Weeks] Fixed reset of nextSizeCheck a057f46 [Daniel Weeks] Fixed inverted property logic e7cd54b [Daniel Weeks] Added property to toggle page size check estimation and initial row size checking Conflicts: parquet-column/src/main/java/org/apache/parquet/column/ParquetProperties.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriteStoreV1.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriteStoreV2.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriterV1.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriterV2.java parquet-column/src/test/java/org/apache/parquet/column/impl/TestCorruptDeltaByteArrays.java parquet-column/src/test/java/org/apache/parquet/column/mem/TestMemColumn.java parquet-column/src/test/java/org/apache/parquet/io/PerfTest.java parquet-column/src/test/java/org/apache/parquet/io/TestColumnIO.java parquet-column/src/test/java/org/apache/parquet/io/TestFiltered.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordWriter.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetOutputFormat.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetRecordWriter.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java parquet-pig/src/test/java/org/apache/parquet/pig/TupleConsumerPerfTest.java parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetReadProtocol.java Resolution: Fixed changes that depended on the addition of an allocator argument Ignored adjacent changes that were flagged Passed page size at compressor instantiation instead of to the factory
This adds properties to set the min and max number of records that are passed between page checks, as well as a property that controls whether the next check will be based on records already seen or set to the minimum number of records between checks. * `parquet.page.size.row.check.min` - minimum number of records between page size checks * `parquet.page.size.row.check.max` - maximum number of records between page size checks * `parquet.page.size.check.estimate` - whether to estimate the number of records before the next check, or to always use the minimum number of records. This also updates the internal API to use ParquetProperties to carry encoding settings (used in parquet-column) to reduce the number of parameters passed through internal APIs. It also adds a builder for ParquetProperties to avoid needing to reference defaults in other modules. This closes apache#250 Author: Daniel Weeks <dweeks@netflix.com> Author: Ryan Blue <blue@apache.org> Closes apache#297 from rdblue/parquet-properties-update and squashes the following commits: c93b73e [Ryan Blue] PARQUET-99: Use ParquetProperties to carry encoding config. 18f8d3a [Daniel Weeks] Spacing 2090719 [Daniel Weeks] Update sizeCheck to write page properly if estimating is turned off 71336ee [Daniel Weeks] Fixed param name 5d99072 [Daniel Weeks] Update page size checking for v2 writer 3f7870c [Daniel Weeks] Rebase to resolve byte buffer conflicts 68794f0 [Daniel Weeks] Merge branch 'master' into page_size_check b49f03c [Daniel Weeks] Fixed reset of nextSizeCheck a057f46 [Daniel Weeks] Fixed inverted property logic e7cd54b [Daniel Weeks] Added property to toggle page size check estimation and initial row size checking Conflicts: parquet-column/src/main/java/org/apache/parquet/column/ParquetProperties.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriteStoreV1.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriteStoreV2.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriterV1.java parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriterV2.java parquet-column/src/test/java/org/apache/parquet/column/impl/TestCorruptDeltaByteArrays.java parquet-column/src/test/java/org/apache/parquet/column/mem/TestMemColumn.java parquet-column/src/test/java/org/apache/parquet/io/PerfTest.java parquet-column/src/test/java/org/apache/parquet/io/TestColumnIO.java parquet-column/src/test/java/org/apache/parquet/io/TestFiltered.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordWriter.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetOutputFormat.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetRecordWriter.java parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetWriter.java parquet-pig/src/test/java/org/apache/parquet/pig/TupleConsumerPerfTest.java parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetReadProtocol.java Resolution: Fixed changes that depended on the addition of an allocator argument Ignored adjacent changes that were flagged Passed page size at compressor instantiation instead of to the factory
Added property to toggle page size check estimation and initial row size checking.