polarsignals/frostdb

pqarrow/arrow.go assert *array.Dictionary only support *array.Binary type

jicanghaixb opened this issue · 3 comments

I use record_builder to create arrow.Record, than insert into frostdb. When i run aggregation query,returns an error: unsupported dictionary type: *array.String. record builder support rle_dict to use “arrow.BinaryTypes.String”,"arrow.PrimitiveTypes.Int64","arrow.PrimitiveTypes.Float64","arrow.FixedWidthTypes.Boolean",

but pqarrow/arrow.go only support *array.Binary
case *array.Dictionary:
b := builder.(*array.BinaryDictionaryBuilder)
switch dict := arr.Dictionary().(type) {
case *array.Binary:
for i := 0; i < toCopy; i++ {
if arr.IsNull(i) {
b.AppendNull()
} else {
if err := b.Append(dict.Value(arr.GetValueIndex(i))); err != nil {
panic("failed to append to dictionary")
}
}
}
default:
panic(fmt.Sprintf("unsupported dictionary type: %T", dict))

Thanks for reporting this. It is a bug, I'm preparing a patch to fix it.

Not completely fixed, arrowutils/groupranges.go,merge.go and builder/utils.go has the same issue.

@jicanghaixb please open a new issue for that. The fix is specifically from your description.