candiduslynx commented on code in PR #35457:
URL: https://github.com/apache/arrow/pull/35457#discussion_r1187636494
##########
go/internal/types/extension_types.go:
##########
@@ -32,26 +32,45 @@ import (
"golang.org/x/xerrors"
)
+var UUID = NewUUIDType()
+
type UUIDBuilder struct {
*array.ExtensionBuilder
}
-func NewUUIDBuilder(bldr *array.ExtensionBuilder) *UUIDBuilder {
- b := &UUIDBuilder{
- ExtensionBuilder: bldr,
- }
- return b
+func NewUUIDBuilder(builder *array.ExtensionBuilder) *UUIDBuilder {
+ return &UUIDBuilder{ExtensionBuilder: builder}
}
func (b *UUIDBuilder) Append(v uuid.UUID) {
b.ExtensionBuilder.Builder.(*array.FixedSizeBinaryBuilder).Append(v[:])
}
+func (b *UUIDBuilder) UnsafeAppend(v uuid.UUID) {
+
b.ExtensionBuilder.Builder.(*array.FixedSizeBinaryBuilder).UnsafeAppend(v[:])
+}
+
+func (b *UUIDBuilder) AppendValueFromString(s string) error {
+ if s == array.NullValueStr {
+ b.AppendNull()
+ return nil
+ }
+
+ b.Append(uuid.MustParse(s))
Review Comment:
Done in 3643d9b61176744c84e0061bc2e99815f659e3db
--
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]