xitongsys / parquet-go

pure golang library for reading/writing parquet file
Apache License 2.0
1.27k stars 293 forks source link

How can I read LIST type of parquet file? #431

Open fllife opened 2 years ago

fllife commented 2 years ago
  1. parquet schema as follow:

    message schema {
    required group value (LIST) {
       repeated group list {
          required double item;
        }
    }
    required binary key (STRING);
    }
  2. golang struct tag as follow:

    type Schema struct {
        Value []float64 `parquet:"name=value, type=LIST, valuetype=DOUBLE"`
    Key   string `parquet:"name=key, type=BYTE_ARRAY"`
    }

    but When I read by reader.NewParquetReader(fr, new(Schema), 4) occur exception:

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x1828db6]

goroutine 187 [running]: github.com/xitongsys/parquet-go/layout.(Table).Pop(0xc0001fdc70, 0x0) /go/pkg/mod/github.com/xitongsys/parquet-go@v1.6.2/layout/table.go:76 +0x176 github.com/xitongsys/parquet-go/reader.(ColumnBufferType).ReadRows(0xc0001fdc70, 0x32) /go/pkg/mod/github.com/xitongsys/parquet-go@v1.6.2/reader/columnbuffer.go:249 +0x17e github.com/xitongsys/parquet-go/reader.(ParquetReader).read.func1() /go/pkg/mod/github.com/xitongsys/parquet-go@v1.6.2/reader/reader.go:286 +0x13e created by github.com/xitongsys/parquet-go/reader.(ParquetReader).read /go/pkg/mod/github.com/xitongsys/parquet-go@v1.6.2/reader/reader.go:279 +0x274

So how can i fix it?