serramatutu commented on code in PR #758:
URL: https://github.com/apache/arrow-go/pull/758#discussion_r3078666313


##########
arrow/array/dictionary.go:
##########
@@ -990,6 +1030,26 @@ type dictBuilder[T arrow.ValueType] struct {
        dictionaryBuilder
 }
 
+func (b *dictBuilder[T]) UnsafeAppend(v T) error {

Review Comment:
   NOTE: Since `Append()` returns `error`, I had done the same thing for and 
`UnsafeAppend()`. However, I noticed the only thing that could return an error 
from `appendValue`, `appendBytes` or `unsafeAppendValue` is 
`b.memoTable.GetOrInsert(val)` since `val` is `interface{}` and the type ID 
could be wrong.
   
   Since `v` is typed explicitly with `T` in `Append()`/`UnsafeAppend()`, it is 
safe to assume there should never be any error, unless there is an 
implementation bug, in which case a panic is better. 
   
   In the latest commit, I changed `UnsafeAppend()` to be infallible, and added 
`TODO` comments for all the other `Append()`, as that would be a breaking 
change to the public API.
   
   What do you think?



-- 
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]

Reply via email to