@@ -432,13 +432,13 @@ func GeometryUngrouped() Rule {
432432 title : "geometry columns must not be grouped" ,
433433 validate : func (info * FileInfo ) error {
434434 metadata := info .Metadata
435- sc := info .File .MetaData ().Schema
435+ root := info .File .MetaData ().Schema . Root ()
436436 for name := range metadata .Columns {
437- index := sc . ColumnIndexByName (name )
437+ index := root . FieldIndexByName (name )
438438 if index < 0 {
439439 return fatal ("missing geometry column %q" , name )
440440 }
441- _ , ok := sc . Root () .Field (index ).(* schema.PrimitiveNode )
441+ _ , ok := root .Field (index ).(* schema.PrimitiveNode )
442442 if ! ok {
443443 return fmt .Errorf ("column %q must not be a group" , name )
444444 }
@@ -454,14 +454,14 @@ func GeometryDataType() Rule {
454454 title : "geometry columns must be stored using the BYTE_ARRAY parquet type" ,
455455 validate : func (info * FileInfo ) error {
456456 metadata := info .Metadata
457- sc := info .File .MetaData ().Schema
457+ root := info .File .MetaData ().Schema . Root ()
458458 for name := range metadata .Columns {
459- index := sc . ColumnIndexByName (name )
459+ index := root . FieldIndexByName (name )
460460 if index < 0 {
461461 return fatal ("missing geometry column %q" , name )
462462 }
463463
464- field , ok := sc . Root () .Field (index ).(* schema.PrimitiveNode )
464+ field , ok := root .Field (index ).(* schema.PrimitiveNode )
465465 if ! ok {
466466 return fatal ("expected primitive column for %q" , name )
467467 }
@@ -480,14 +480,14 @@ func GeometryRepetition() Rule {
480480 title : "geometry columns must be required or optional, not repeated" ,
481481 validate : func (info * FileInfo ) error {
482482 metadata := info .Metadata
483- sc := info .File .MetaData ().Schema
483+ root := info .File .MetaData ().Schema . Root ()
484484 for name := range metadata .Columns {
485- index := sc . ColumnIndexByName (name )
485+ index := root . FieldIndexByName (name )
486486 if index < 0 {
487487 return fatal ("missing geometry column %q" , name )
488488 }
489489
490- repetitionType := sc . Root () .Field (index ).RepetitionType ()
490+ repetitionType := root .Field (index ).RepetitionType ()
491491 if repetitionType == parquet .Repetitions .Repeated {
492492 return fmt .Errorf ("column %q must not be repeated" , name )
493493 }
0 commit comments