From 5a22458990fa1225ad2df5d154b8fce795331628 Mon Sep 17 00:00:00 2001 From: Efstathios Chouliaris Date: Thu, 19 Sep 2024 15:50:12 -0500 Subject: [PATCH] try to recreate the issue with UUID to solve #1209 --- converter_test.go | 9 +++++++++ go.mod | 1 + go.sum | 1 + 3 files changed, 11 insertions(+) diff --git a/converter_test.go b/converter_test.go index 102660d8d..af8aa6c62 100644 --- a/converter_test.go +++ b/converter_test.go @@ -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) { @@ -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") diff --git a/go.mod b/go.mod index 7749971f2..2134bf359 100644 --- a/go.mod +++ b/go.mod @@ -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.0 golang.org/x/crypto v0.17.0 diff --git a/go.sum b/go.sum index e5b3ef444..5cf1e6a18 100644 --- a/go.sum +++ b/go.sum @@ -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=