Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wgtmac
Copy link
Member

@wgtmac wgtmac commented Oct 30, 2024

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:

optional group a (LIST) {
  repeated group array (LIST) {
    repeated int32 array;
  }
}

See apache/arrow#43994 and apache/arrow#43995

What changes are included in this PR?

Clarify the rules and add an example.

Do these changes have PoC implementations?

Not required

Closes #465

@wgtmac wgtmac force-pushed the old-list-structure branch 3 times, most recently from abc3d1d to d9579bc Compare October 30, 2024 03:23
@mapleFU
Copy link
Member

mapleFU commented Oct 30, 2024

BTW, can you also point out the Java code in this pr?

LogicalTypes.md Outdated Show resolved Hide resolved
@mapleFU
Copy link
Member

mapleFU commented Oct 30, 2024

Other LGTM but I think it worths issue a disscussion...

@wgtmac
Copy link
Member Author

wgtmac commented Oct 30, 2024

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

LogicalTypes.md Outdated Show resolved Hide resolved
Copy link
Contributor

@etseidl etseidl left a 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?

repeated type is the element type and elements are required.
element type and elements are required. In this case, the element type is
a Struct type with multiple fields.
3. If the repeated field is a group (without annotation) with one `required` or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. If the repeated field is a group (without annotation) with one `required` or
3. If the repeated field is a group (without `LIST` annotation) with one `required` or

Not sure if this should be made explicit.

repeated type is the element type and elements are required.
element type and elements are required. In this case, the element type is
a Struct type with multiple fields.
3. If the repeated field is a group (without annotation) with one `required` or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might leave the entire block as it was previously and clarify that:

  1. Without annotatation the type is a single struct/tuple with the element in it.
  2. With a logical type annotation (I think only LIST and MAP apply here).

I also think we need to update the documentation above:

The outer-most level must be a group annotated with `LIST` that contains a
  single field named `list`. The repetition of this level must be either
  `optional` or `required` and determines whether the list is nullable.

To point to the fact that for backwards compatibility it can also be repeated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backward-compatibility rules on LIST type is unclear
4 participants