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 Oct 10, 2024
1 parent 807e035 commit c962f5f
Show file tree
Hide file tree
Showing 3 changed files with 11 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 @@ -14,6 +14,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
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVI
github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg=
github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
Expand Down

0 comments on commit c962f5f

Please sign in to comment.