zeroshade commented on code in PR #36697:
URL: https://github.com/apache/arrow/pull/36697#discussion_r1265567815


##########
go/parquet/schema/helpers.go:
##########
@@ -52,15 +52,50 @@ func ListOf(n Node, rep parquet.Repetition, fieldID int32) 
(*GroupNode, error) {
        return NewGroupNodeLogical(listName, rep, FieldList{list}, 
ListLogicalType{}, fieldID)
 }
 
+// ListOf is a convenience helper function to create a properly structured
+// list structure according to the Parquet Spec.
+//
+//     <list-repetition> group <name> (LIST) {
+//       repeated group list {
+//         <element-repetition> <element-type> element;
+//       }
+//     }
+//
+// <list-repetition> can only be optional or required.
+// <element-repetition> can only be optional or required.
+func ListOfWithName(listName string, element Node, rep parquet.Repetition, 
fieldID int32) (*GroupNode, error) {
+       if rep == parquet.Repetitions.Repeated {
+               return nil, xerrors.Errorf("parquet: listof repetition must not 
be repeated, got :%s", rep)
+       }
+
+       if rep == parquet.Repetitions.Repeated || element.RepetitionType() == 
parquet.Repetitions.Repeated {

Review Comment:
   `rep == parquet.Repetitions.Repeated` is redundant here as it is already 
checked above this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to