You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "akehlenbeck (via GitHub)" <gi...@apache.org> on 2025/09/23 15:25:57 UTC
[I] dictionaryBuilder: panic on mismatch between arrow.Duration and int64 [arrow-go]
akehlenbeck opened a new issue, #516:
URL: https://github.com/apache/arrow-go/issues/516
### Describe the bug, including details regarding any error messages, version, and platform.
Go 1.24.2 on linux/amd64
github.com/apache/arrow-go/v18 v18.4.1
The following program panics on a mismatch in `dictionaryBuilder` between `arrow.Duration` and `int64`:
```
package main
import (
"fmt"
"github.com/apache/arrow-go/v18/arrow"
"github.com/apache/arrow-go/v18/arrow/array"
"github.com/apache/arrow-go/v18/arrow/memory"
)
func main() {
dictType := &arrow.DictionaryType{IndexType: &arrow.Int8Type{}, ValueType: arrow.FixedWidthTypes.Duration_ns}
bldr := array.NewDictionaryBuilder(memory.DefaultAllocator, dictType)
defer bldr.Release()
builder := bldr.(*array.DurationDictionaryBuilder)
if err := builder.Append(arrow.Duration(1)); err == nil {
fmt.Println("success")
} else {
fmt.Println(err)
}
}
```
Output:
```
panic: interface conversion: interface {} is arrow.Duration, not int64
goroutine 1 [running]:
github.com/apache/arrow-go/v18/internal/hashing.(*Table[...]).GetOrInsert(0x469039?, {0x6622a0?, 0x73dd08?})
/home/.../go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.1/internal/hashing/xxh3_memo_table_types.go:255 +0x49
github.com/apache/arrow-go/v18/arrow/array.(*dictionaryBuilder).appendValue(0xc0000b40e0, {0x6622a0?, 0x73dd08?})
/home/.../go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.1/arrow/array/dictionary.go:785 +0x2b
github.com/apache/arrow-go/v18/arrow/array.(*dictBuilder[...]).Append(...)
/home/.../go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.1/arrow/array/dictionary.go:994
main.main()
/home/.../go/arrow-bug/main.go:17 +0x118
exit status 2
```
I am not particularly familiar with arrow-go but I believe the calling code is valid, and that the construction of the internal MemoTable may be losing the distinction between arrow.Duration and int64. The same problem may also exist for a handful of other types but I didn't investigate closely.
(Please let me know if the calling code _isn't_ valid. The program above is extracted from a complicated open-telemetry deployment that is panicking when trying to use arrow on the wire; if something about the calling pattern above is incorrect then I will have to go looking elsewhere for the problem.)
### 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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] dictionaryBuilder: panic on mismatch between arrow.Duration and int64 [arrow-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade closed issue #516: dictionaryBuilder: panic on mismatch between arrow.Duration and int64
URL: https://github.com/apache/arrow-go/issues/516
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] dictionaryBuilder: panic on mismatch between arrow.Duration and int64 [arrow-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #516:
URL: https://github.com/apache/arrow-go/issues/516#issuecomment-3324630072
You're right, that should be perfectly valid. I'll see what I can do to fix that
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org