PARQUET-229 Add a strict thrift projection API with backwards compat support#150
Closed
isnotinvain wants to merge 19 commits intoapache:masterfrom
isnotinvain:alexlevenson/strict-projection
Closed
PARQUET-229 Add a strict thrift projection API with backwards compat support#150isnotinvain wants to merge 19 commits intoapache:masterfrom isnotinvain:alexlevenson/strict-projection
isnotinvain wants to merge 19 commits intoapache:masterfrom
isnotinvain:alexlevenson/strict-projection
Conversation
Contributor
Author
Contributor
Author
There was a problem hiding this comment.
just wanted to call this question out
Member
There was a problem hiding this comment.
Filters are defined in terms of the thrift schema and T has to be either a Thrift of Scrooge generated class.
Possibly this should be refactored or renamed.
Contributor
Author
|
Tests running here: https://travis-ci.org/isnotinvain/incubator-parquet-mr/builds/55340816 |
Conflicts: parquet-common/src/main/java/parquet/hadoop/metadata/ColumnPath.java
Contributor
Author
Contributor
|
could you also update this doc with the new API? https://github.com/apache/incubator-parquet-mr/blob/master/parquet_cascading.md |
Contributor
|
minor comment, otherwise LGTM |
Conflicts: parquet-common/src/main/java/org/apache/parquet/hadoop/metadata/ColumnPath.java parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/ThriftReadSupport.java parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConvertVisitor.java parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConverter.java parquet-thrift/src/main/java/org/apache/parquet/thrift/projection/PathGlobPattern.java parquet-thrift/src/main/java/parquet/thrift/projection/PathGlobPattern.java parquet-thrift/src/main/java/parquet/thrift/projection/deprecated/PathGlobPattern.java parquet-thrift/src/test/java/org/apache/parquet/thrift/TestThriftSchemaConverter.java parquet-thrift/src/test/java/org/apache/parquet/thrift/projection/PathGlobPatternTest.java parquet-thrift/src/test/java/parquet/thrift/projection/PathGlobPatternTest.java parquet-thrift/src/test/java/parquet/thrift/projection/deprecated/PathGlobPatternTest.java
Conflicts: parquet-thrift/src/main/java/org/apache/parquet/hadoop/thrift/ThriftReadSupport.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the thrift projection API accepts strings in a very general glob format that supports not only wildcards like
*and?and expansions ({x,y,z}) but also character classes[abc], and negation.Because of this flexibility, it's hard to give users good error reporting, for example letting them know that when they requested columns
foo.bar.{a,b,c}there is actually no such columnfoo.bar.c.This PR introduces a new syntax that supports a more restrictive form of glob syntax and enforces that all expansions of a glob match a column, not just that all globs match a column. The new syntax is very simple and only has four special characters:
{,},,, and*It supports glob expansion, for example:
home.{phone,address}ororg.apache{-incubator,}.fooAnd the wildcard
*which is treated the same way as java regex treats(.*), for example:home.*ororg.apache*.fooIn the new syntax glob paths mean "keep all the child fields of the field matched by this glob", just like variable access would work in a programming language. For example:
x.y.zmeans keep fieldzand all of its children (if any). So it's not necessary to dox.y.z.*. However,x.y.zwould not keep fieldx.y.zoo. If that was desired, thenx.y.z*could be used instead.Setting
"parquet.thrift.column.filter"will result in the same behavior that it does currently in master, though a deprecation warning will be logged. The classes that implement the current behavior have been marked as deprecated, and using this will log a warning.Setting
"parquet.thrift.column.projection.globs"will instead use this new syntax, and entry points in the various Builder's in the codebase is added as well.This PR does a little bit of cleanup as well, moving some shared methods to a
Stringsclass and simplifying some of the class hierarchy inThriftSchemaConverterVisitor. There are a few// TODO Why?added as well that I wanted to ask about.