-
Notifications
You must be signed in to change notification settings - Fork 1.5k
PARQUET-223: Add builders for MAP and LIST types #148
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
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.
Should add docs for
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.
Sorry, should add docs for all type parameters.
|
Looks like the test failures are caused by incompatible changes flagged by semver. I don't think they are actually incompatible because you moved the methods to a superclass, but we'll need to add a temporary exception here: https://github.com/apache/parquet-mr/blob/master/pom.xml#L240 |
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.
Okay, I think we still need a couple of methods that were overlooked: key(Type) so you can make more complex types than are supported by the builders. Then we will also need value(Type), requiredValue(Type), and optionalValue(Type) on the key builders that set the value type.
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.
True. Adding them.
|
Super close. I think we just need to add a couple of methods and remove some stuff. Still need to add the methods that take I didn't quite understand the key builders within List either, and what made them distinct from the mapElement builder. I don't think they are needed either. One last thing: can you rebase on master? Thanks! |
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.
Nit: style is off for these methods: shouldn't have a space before the open paren.
|
Okay, I've done one more look through. There are two things still holding it up:
I also noted a few other things that I haven't seen before. Not blockers, but we may as well fix them:
|
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.
It just occurred to me that repetition is ignored because the Type includes a repetition. Maybe we don't need requiredElement and optionalElement after all. Same with the key and value methods that take a Type.
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.
Done. Thanks again for catching this.
On Sun, May 17, 2015 at 2:07 PM, Ryan Blue notifications@github.com wrote:
In parquet-column/src/main/java/org/apache/parquet/schema/Types.java
#148 (comment):
if (parent != null) {return new ListElementBuilder<P, Q>(this).repetition(repetition);} else {return new ListElementBuilder<P, Q>(this, returnType).repetition(repetition);}- }
- public ListElementBuilder<P, Q> requiredListElement() {
return listElement(Type.Repetition.REQUIRED);- }
- public ListElementBuilder<P, Q> optionalListElement() {
return listElement(Type.Repetition.OPTIONAL);- }
- public BaseListBuilder<P, Q> element(Type type, Type.Repetition repetition) {
It just occurred to me that repetition is ignored because the Type
includes a repetition. Maybe we don't need requiredElement and
optionalElement after all. Same with the key and value methods that take
a Type.—
Reply to this email directly or view it on GitHub
https://github.com/apache/parquet-mr/pull/148/files#r30474900.
Regards,
Ashish
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.
There are a lot of non-functional changes to the white space that look non-standard.
As of now, Parquet does not provide builders for Maps and Lists. This leaves margin for user errors. Having Map and List builders will make it easier for users to build these types.