hcrosse opened a new issue, #1562:
URL: https://github.com/apache/arrow-go/issues/1562
### Describe the enhancement requested
I'd like builders for `dictionary<int32, V>` where `V` is `string_view`,
`binary_view`, `large_utf8` or `large_binary`. Dictionary arrays with these
value types can already be constructed and validated, but the builders do not
support them.
I reproduced this on v18.8.0 and main, with Go 1.26.10 on macOS arm64.
Each of these calls panics for all four types. Here is the `string_view`
case:
```go
dt := &arrow.DictionaryType{IndexType: arrow.PrimitiveTypes.Int32,
ValueType: arrow.BinaryTypes.StringView}
array.NewBuilder(mem, dt)
array.FromJSON(mem, dt, strings.NewReader(`["YQ==", null, "YQ=="]`))
array.NewRecordBuilder(mem, arrow.NewSchema([]arrow.Field{{Name: "f", Type:
dt, Nullable: true}}, nil))
```
```text
arrow/array: unsupported builder for value type of *arrow.DictionaryType
```
The panic names the dictionary type, not the unsupported value type.
`createMemoTable` has no cases for the four types, and
`NewDictionaryBuilderWithDict` turns its error into this panic:
https://github.com/apache/arrow-go/blob/fc5d5ce5a99b8583448b2cb70d0e9357dd10a420/arrow/array/dictionary.go#L596-L634
https://github.com/apache/arrow-go/blob/fc5d5ce5a99b8583448b2cb70d0e9357dd10a420/arrow/array/dictionary.go#L738-L751
`NewDictionaryUnifier` returns `unimplemented dictionary value type` for the
same four types.
`GetDictArrayData` already handles `large_utf8` and `large_binary`:
https://github.com/apache/arrow-go/blob/fc5d5ce5a99b8583448b2cb70d0e9357dd10a420/arrow/array/util.go#L355-L364
Arrow C++'s dictionary builder factory supports all four:
https://github.com/apache/arrow/blob/976779b2aac587f51b87c3bd2e6ae4c36f75ab6c/cpp/src/arrow/builder.cc#L184-L188
I can open a PR for this.
### Component(s)
Other
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]