-
Notifications
You must be signed in to change notification settings - Fork 434
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
GH-465: Clarify backward-compatibility rules on LIST type #466
base: master
Are you sure you want to change the base?
Conversation
abc3d1d
to
d9579bc
Compare
BTW, can you also point out the Java code in this pr? |
Other LGTM but I think it worths issue a disscussion... |
4551c79
to
f200d34
Compare
I have sent a discussion thread to the dev ML. It would be good if you can take a look. Thanks! @emkornfield @pitrou @gszadovszky @rdblue @etseidl @clairemcginty |
f200d34
to
fc8aca3
Compare
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.
Seems like a nice clarification to me. One little (ignorable) nit.
I'm also wondering if we should add an example above for the non-LIST annotated repeating fields, or should that be a new PR?
This comment was marked as resolved.
This comment was marked as 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.
Thanks for clarifying! This is so tricky especially rule 3 and rule 4 in 2-level lists...
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.
Thanks for being patient with me Gang 😄. And thanks for taking on this needed clarification.
@etseidl I think we are on the same page that current rule 3 has an issue that it does not forbid the inner-most layer to be |
Ok, so the new Rule 3 is in effect saying that if the child of the repeated middle group is repeated, then because 1-level and LIST/MAP annotated schemas cannot mix, the middle group cannot be the type so the child is the type. The side consequence of this is that the middle group has to have a So is it true then that the
|
No, the middle level can never be a LIST-annotated or MAP-annotated 3-level structure, because they cannot be
You're right. A LIST-annotated 2-level structure can only be repeated when it is a direct child of another LIST-annotated 2-level structure. I had missed the statement that disallows annotated and unannotated types to be mixed and modified these rules back and forth. Now this is pretty clear. Let me reflect these discussions in the PR. |
Ah, ok. Now I understand. That's why the 2-level list needs the ability to be |
@gszadovszky @etseidl @rdblue @pitrou @emkornfield Do you have any concern about this PR? I think we need to move forward now. |
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.
All my concerns have been addressed. Thanks!
Co-authored-by: emkornfield <[email protected]>
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.
Rest LGTM
repeated group my_list { | ||
required int32 num; | ||
optional binary str (STRING); | ||
} |
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.
I think this example is counter-productive. We don't want anyone using un-annotated lists and maps. While the paragraph above explains how to interpret un-annotated repeated
fields, I don't want anyone to see an example here and think that it is something that should be copied. I think it is already clear enough and I would simply move on rather than drawing attention to this as a possibility.
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.
That make sense. Let me remove these examples first. I think a followup is to deprecate it by moving it to the backward compatibility section and adding strong words to discourage writers to emit it.
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 rules part is looking good, but I think that spending time documenting what people did incorrectly years ago makes the doc more confusing and increases chances that people will write invalid lists. I'd prefer to revert most of the changes that explain what people did incorrectly.
I agree. But I think those can be posted on the pull-request description |
@rdblue Thanks for your review! I have removed all unnecessary changes. Please take a look again. |
or uses the `LIST`-annotated group's name with `_tuple` appended then the | ||
repeated type is the element type and elements are required. | ||
4. Otherwise, the repeated field's type is the element type with the repeated | ||
5. Otherwise, the repeated field's type is the element type with the repeated |
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 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.
I don't want to add an example for rule 5 because it is already at line 685
@rdblue @wgtmac I'm not sure I agree with removing the examples. They make it less likely that an implementation would interpret the written rules wrongly, IMO. Maybe we can instead strengthen the wording that these examples show existing legacy schemas, not anything to be written by modern writers. |
Concretely, if I have to review a PR implementing said compatibility rules, I'd rather have the spec spell out the examples because it makes it easier to check the PR's implementation (and unit tests!). |
Perhaps add them like this? @pitrou
|
Ok, please don't use UPPERCASE :) |
Rationale for this change
The C++ reader of parquet-cpp is having a hard time to read Parquet file written by parquet-java with
parquet.avro.write-old-list-structure=true
and schema below:See apache/arrow#43994 and apache/arrow#43995
What changes are included in this PR?
Clarify the rules for various list types.
Do these changes have PoC implementations?
Not required
Closes #465