Closed Arnold1 closed 2 years ago
@hangxie how would you write the following with the BufferFile?
func LoadParquetData(content []byte) ([]Foo, error) {
fr, err := goparquet.NewFileReader(bytes.NewReader(content))
if err != nil {
return nil, err
}
rows := fr.NumRows()
f := make([]Foo, rows)
for i := int64(0); i < rows; i++ {
row, err := fr.NextRow()
if err == io.EOF {
break
}
if err != nil {
return nil, errors.Wrap(err, "Reading record failed")
}
for k, v := range row {
if k == "value" {
if vv, ok := v.([]byte); ok {
f[i].Value = string(vv)
}
}
}
}
return f, err
}
Hi,
I have []bytes which represent a parquet file - how can I read parquet using an in memory reader?
Thanks