emkornfield commented on a change in pull request #10071:
URL: https://github.com/apache/arrow/pull/10071#discussion_r616853211



##########
File path: go/parquet/schema/column.go
##########
@@ -0,0 +1,125 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package schema
+
+import (
+       "fmt"
+       "strings"
+
+       "github.com/apache/arrow/go/parquet"
+       format "github.com/apache/arrow/go/parquet/internal/gen-go/parquet"
+)
+
+// Column encapsulates the information necessary to interpret primitive
+// column data in the context of a particular schema. We have to examine
+// the node structure of a column's path to the root in the schema tree
+// to be able to reassemble the nested structure from the repetition and
+// definition levels.
+type Column struct {
+       pnode     *PrimitiveNode
+       maxDefLvl int16
+       maxRepLvl int16
+}
+
+func (c *Column) hasSpacedValues() bool {
+       if c.maxRepLvl > 0 {
+               // repeated + flat case
+               return c.pnode.RepetitionType() != parquet.Repetitions.Required
+       }
+
+       // non-repeated+nested case
+       // find if a node forces nulls in the lowest level along the hierarchy
+       var n Node = c.pnode
+       for n != nil {
+               if n.RepetitionType() == parquet.Repetitions.Optional {

Review comment:
       not sure if you saw comment above.  I think this is right since there is 
no repeated fields here.  I don't think this affects correctness but I think 
the check above isn't quite correct here or in C++.  really we need to walk the 
tree in both cases. Until either the top or a repeated field is hit




-- 
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.

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


Reply via email to