Skip to content

Commit

Permalink
try to recreate the issue with UUID to solve snowflakedb#1209
Browse files Browse the repository at this point in the history
  • Loading branch information
ChronosMasterOfAllTime committed Nov 19, 2024
1 parent e05cc79 commit 2bd2116
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/apache/arrow/go/v15/arrow/array"
"github.com/apache/arrow/go/v15/arrow/decimal128"
"github.com/apache/arrow/go/v15/arrow/memory"
"github.com/google/uuid"
)

func stringIntToDecimal(src string) (decimal128.Num, bool) {
Expand Down Expand Up @@ -282,6 +283,14 @@ func TestValueToString(t *testing.T) {
assertEqualE(t, *bv.value, "[1,2]")
})

t.Run("UUID - should return string", func(t *testing.T) {
u := uuid.New()
bv, err := valueToString(u, textType, nil)
assertNilF(t, err)
assertEmptyStringE(t, bv.format)
assertEqualE(t, *bv.value, u.String())
})

bv, err = valueToString(&testValueToStringStructuredObject{s: "some string", i: 123, date: time.Date(2024, time.May, 24, 0, 0, 0, 0, time.UTC)}, timestampLtzType, params)
assertNilF(t, err)
assertEqualE(t, bv.format, "json")
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/aws/smithy-go v1.20.2
github.com/gabriel-vasile/mimetype v1.4.2
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/uuid v1.3.1
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/sirupsen/logrus v1.9.3
golang.org/x/crypto v0.17.0
Expand Down

0 comments on commit 2bd2116

Please sign in to comment.