zeroshade commented on code in PR #37309:
URL: https://github.com/apache/arrow/pull/37309#discussion_r1303543212


##########
go/arrow/array/dictionary.go:
##########
@@ -1674,6 +1674,135 @@ func (u *unifier) GetResultWithIndexType(indexType 
arrow.DataType) (arrow.Array,
        return MakeFromData(dictData), nil
 }
 
+type binaryUnifier struct {
+       mem       memory.Allocator
+       memoTable *hashing.BinaryMemoTable
+}
+
+// NewBinaryDictionaryUnifier constructs and returns a new dictionary unifier 
for dictionaries
+// of binary values, using the provided allocator for allocating the unified 
dictionary
+// and the memotable used for building it.
+func NewBinaryDictionaryUnifier(alloc memory.Allocator) DictionaryUnifier {
+       return &binaryUnifier{
+               mem:       alloc,
+               memoTable: hashing.NewBinaryMemoTable(0, 0, 
NewBinaryBuilder(alloc, arrow.BinaryTypes.Binary)),
+       }
+}
+
+func (u *binaryUnifier) Release() {
+       u.memoTable.Release()
+}
+
+func (u *binaryUnifier) Unify(dict arrow.Array) (err error) {
+       if !arrow.TypeEqual(arrow.BinaryTypes.Binary, dict.DataType()) {
+               return fmt.Errorf("dictionary type different from unifier: %s, 
expected: %s", dict.DataType(), arrow.BinaryTypes.Binary)
+       }

Review Comment:
   Ah! I completely forgot that I had the exported interface. My bad there. I 
think it's better to follow the interface for now probably.



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