Skip to content

Commit

Permalink
Merge branch 'master' into SNOW-999076-easy-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pbulawa authored Jan 11, 2024
2 parents 97d06f6 + 72af178 commit 88295b2
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 125 deletions.
6 changes: 3 additions & 3 deletions arrow_chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"encoding/base64"
"time"

"github.com/apache/arrow/go/v12/arrow"
"github.com/apache/arrow/go/v12/arrow/ipc"
"github.com/apache/arrow/go/v12/arrow/memory"
"github.com/apache/arrow/go/v14/arrow"
"github.com/apache/arrow/go/v14/arrow/ipc"
"github.com/apache/arrow/go/v14/arrow/memory"
)

type arrowResultChunk struct {
Expand Down
3 changes: 3 additions & 0 deletions azure_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func (util *snowflakeAzureClient) createClient(info *execResponseStageInfo, _ bo
MaxRetries: 60,
RetryDelay: 2 * time.Second,
},
Transport: &http.Client{
Transport: SnowflakeTransport,
},
},
})
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions chunk_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"sync"
"time"

"github.com/apache/arrow/go/v12/arrow"
"github.com/apache/arrow/go/v12/arrow/ipc"
"github.com/apache/arrow/go/v12/arrow/memory"
"github.com/apache/arrow/go/v14/arrow"
"github.com/apache/arrow/go/v14/arrow/ipc"
"github.com/apache/arrow/go/v14/arrow/memory"
)

type chunkDownloader interface {
Expand Down
4 changes: 2 additions & 2 deletions chunk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"sync/atomic"
"testing"

"github.com/apache/arrow/go/v12/arrow/ipc"
"github.com/apache/arrow/go/v12/arrow/memory"
"github.com/apache/arrow/go/v14/arrow/ipc"
"github.com/apache/arrow/go/v14/arrow/memory"
)

func TestBadChunkData(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/test_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ if [[ -n "$GITHUB_WORKFLOW" ]]; then
fi
env | grep SNOWFLAKE | grep -v PASS | sort
cd $TOPDIR
go test -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -v .
go test -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -v .
6 changes: 3 additions & 3 deletions cmd/arrow/batches/arrow_batches.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"database/sql/driver"
"flag"
"fmt"
"github.com/apache/arrow/go/v12/arrow"
"github.com/apache/arrow/go/v12/arrow/array"
"github.com/apache/arrow/go/v12/arrow/memory"
"github.com/apache/arrow/go/v14/arrow"
"github.com/apache/arrow/go/v14/arrow/array"
"github.com/apache/arrow/go/v14/arrow/memory"
"log"
"sync"
"time"
Expand Down
2 changes: 1 addition & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"sync/atomic"
"time"

"github.com/apache/arrow/go/v12/arrow/ipc"
"github.com/apache/arrow/go/v14/arrow/ipc"
)

const (
Expand Down
10 changes: 5 additions & 5 deletions converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
"strings"
"time"

"github.com/apache/arrow/go/v12/arrow"
"github.com/apache/arrow/go/v12/arrow/array"
"github.com/apache/arrow/go/v12/arrow/compute"
"github.com/apache/arrow/go/v12/arrow/decimal128"
"github.com/apache/arrow/go/v12/arrow/memory"
"github.com/apache/arrow/go/v14/arrow"
"github.com/apache/arrow/go/v14/arrow/array"
"github.com/apache/arrow/go/v14/arrow/compute"
"github.com/apache/arrow/go/v14/arrow/decimal128"
"github.com/apache/arrow/go/v14/arrow/memory"
)

const format = "2006-01-02 15:04:05.999999999"
Expand Down
8 changes: 4 additions & 4 deletions converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import (
"testing"
"time"

"github.com/apache/arrow/go/v12/arrow"
"github.com/apache/arrow/go/v12/arrow/array"
"github.com/apache/arrow/go/v12/arrow/decimal128"
"github.com/apache/arrow/go/v12/arrow/memory"
"github.com/apache/arrow/go/v14/arrow"
"github.com/apache/arrow/go/v14/arrow/array"
"github.com/apache/arrow/go/v14/arrow/decimal128"
"github.com/apache/arrow/go/v14/arrow/memory"
)

func stringIntToDecimal(src string) (decimal128.Num, bool) {
Expand Down
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,12 +958,12 @@ Note: PUT statements are not supported for multi-statement queries.
The following example shows how to run a GET command by passing a string to the
db.Query() function:
db.Query("GET file://<local_file> <stage_identifier> <optional_parameters>")
db.Query("GET <internal_stage_identifier> file://<local_file> <optional_parameters>")

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / AZURE Go 1.21 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / GCP Go 1.19 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / AWS Go 1.21 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / AZURE Go 1.19 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / GCP Go 1.21 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / AWS Go 1.20 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / AWS Go 1.19 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / AZURE Go 1.20 on Windows

package comment is detached; there should be no blank lines between it and the package statement

Check failure on line 962 in doc.go

View workflow job for this annotation

GitHub Actions / GCP Go 1.20 on Windows

package comment is detached; there should be no blank lines between it and the package statement
"<local_file>" should include the file path as well as the name. Snowflake recommends using
an absolute path rather than a relative path. For example:
db.Query("GET file:///tmp/my_data_file @~ auto_compress=false overwrite=false")
db.Query("GET @~ file:///tmp/my_data_file auto_compress=false overwrite=false")
## Specifying temporary directory for encryption and compression
Expand Down
15 changes: 9 additions & 6 deletions gcs_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ func (util *snowflakeGcsClient) getFileHeader(meta *fileMetadata, filename strin
for k, v := range gcsHeaders {
req.Header.Add(k, v)
}
var client gcsAPI
client = &http.Client{}
client := newGcsClient()
// for testing only
if meta.mockGcsClient != nil {
client = meta.mockGcsClient
Expand Down Expand Up @@ -216,8 +215,7 @@ func (util *snowflakeGcsClient) uploadFile(
for k, v := range gcsHeaders {
req.Header.Add(k, v)
}
var client gcsAPI
client = &http.Client{}
client := newGcsClient()
// for testing only
if meta.mockGcsClient != nil {
client = meta.mockGcsClient
Expand Down Expand Up @@ -295,8 +293,7 @@ func (util *snowflakeGcsClient) nativeDownloadFile(
for k, v := range gcsHeaders {
req.Header.Add(k, v)
}
var client gcsAPI
client = &http.Client{}
client := newGcsClient()
// for testing only
if meta.mockGcsClient != nil {
client = meta.mockGcsClient
Expand Down Expand Up @@ -390,3 +387,9 @@ func (util *snowflakeGcsClient) generateFileURL(stageLocation string, filename s
func (util *snowflakeGcsClient) isTokenExpired(resp *http.Response) bool {
return resp.StatusCode == 401
}

func newGcsClient() gcsAPI {
return &http.Client{
Transport: SnowflakeTransport,
}
}
36 changes: 15 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/99designs/keyring v1.2.2
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0
github.com/apache/arrow/go/v12 v12.0.1
github.com/apache/arrow/go/v14 v14.0.2
github.com/aws/aws-sdk-go-v2 v1.17.7
github.com/aws/aws-sdk-go-v2/credentials v1.13.18
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.59
Expand All @@ -16,15 +16,13 @@ require (
github.com/gabriel-vasile/mimetype v1.4.2
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/sirupsen/logrus v1.9.0
golang.org/x/crypto v0.15.0
golang.org/x/crypto v0.17.0
)

require (
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 // indirect
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/apache/thrift v0.16.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.31 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.25 // indirect
Expand All @@ -34,31 +32,27 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.25 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.0 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/goccy/go-json v0.10.0 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v23.1.21+incompatible // indirect
github.com/google/flatbuffers v23.5.26+incompatible // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/asmfmt v1.3.2 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/stretchr/testify v1.8.1 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/term v0.14.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/tools v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Loading

0 comments on commit 88295b2

Please sign in to comment.