-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gosnowflake unable to use because aws sdk update. #970
Comments
Hi! Same problem here. I use this simple workaround for the moment:
Package replacements:
With that, I'm able to continue to work with the go client for snowflake. There will be a patch for such a problem? |
hi and thank you for reporting this issue and for sharing the workaround while the proper fix is in ! we're taking a look and i'll share progress on this thread as events unfold. |
--> current status: fix underway on #971 |
so we're trying to figure out what situation brought this issue for you folks and if anyone could describe the exact steps taken, that would be immensely helpful. we observed that just by
it doesn't update the AWS SDK. did any of you by any chance upgrade the AWS SDK apart from the |
In our case, the issue was surfaced when both Snowflake SDK and AWS SDK were updated to the latest. |
In my case, I just made a |
thank you ! does your project by any chance depend on |
No, it doesn't. The main require was |
makes sense, thank you! per
which I guess what forced the newer AWS SDK to be downloaded instead of the version specified in the this is a very good insight, thank you ! |
Again thank you all of you who provided your inputs for us to better understand how this breaks in your environment, without After a long discussion and considering:
we decided to hold this PR and postpone it into the January release. We're aware this might not be an ideal situation, but considering all of the factors and the effects, this is what we went with. For those of you who are affected by AWS releasing the breaking change under a MINOR version change and thus This thread will be kept updated with the progress, which is unlikely to happen until January release I'm afraid. |
Was going to open a separate ticket, but diff --git a/s3_storage_client.go b/s3_storage_client.go
index 82638e7..c8066de 100644
--- a/s3_storage_client.go
+++ b/s3_storage_client.go
@@ -100,9 +100,13 @@ func (util *snowflakeS3Client) getFileHeader(meta *fileMetadata, filename string
out.Metadata[amzMatdesc],
}
}
+ var contentLength int64
+ if out.ContentLength != nil {
+ contentLength = *out.ContentLength
+ }
return &fileHeader{
out.Metadata[sfcDigest],
- out.ContentLength,
+ contentLength,
&encMeta,
}, nil
} I would open a PR for it, but I don't have the ability to run all the unit tests for this driver. |
As I realized this wouldn't be backwards compatible, here's a quick version that would work for either version of the SDK: diff --git a/s3_storage_client.go b/s3_storage_client.go
index 82638e7..f67287c 100644
--- a/s3_storage_client.go
+++ b/s3_storage_client.go
@@ -102,7 +102,7 @@ func (util *snowflakeS3Client) getFileHeader(meta *fileMetadata, filename string
}
return &fileHeader{
out.Metadata[sfcDigest],
- out.ContentLength,
+ convContentLength(out.ContentLength),
&encMeta,
}, nil
}
@@ -281,3 +281,15 @@ func (util *snowflakeS3Client) getS3Object(meta *fileMetadata, filename string)
Key: &s3path,
}, nil
}
+
+func convContentLength(v interface{}) int64 {
+ switch x := v.(type) {
+ case int64:
+ return x
+ case *int64:
+ if x != nil {
+ return *x
+ }
+ }
+ return 0
+} |
nice idea, thank you @kenshaw ! |
so thanks to your above contribution, we can implement and release the fix after all most likely in the December release without upgrading the dependencies - which release should be upcoming in the near future. will keep this thread posted |
@sfc-gh-dszmolka Glad this worked for you! |
New workaround until a release is cut
|
That latest workaround causes my build to crash w/o any context ( I also tried to use the latest version |
Hi @gtomitsuka ! Is there a chance of some repro? All our tests pass either on older version of AWS SDK (master) or after bumping library after the breaking change (https://github.com/snowflakedb/gosnowflake/actions/runs/7111880779) |
Nevermind, it's unrelated; I tried with the original fix on v1.7.0 ( |
released with 1.7.1, closing |
gosnowflake unable to use because https://github.com/aws/aws-sdk-go-v2/releases/tag/release-2023-11-17, it changed s3 HeadObjectOutput.ContentLength from int64 to pointer int64, which make anything unable to build/test.
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of GO driver are you using?
v1.7.0
What operating system and processor architecture are you using?
MacOS, 13.5.2 (22G91), M1 pro
What version of GO are you using?
go version go1.21.3 darwin/arm64
4.Server version:* E.g. 1.90.1
not important
5. What did you do?
just testing a unrelated test.
No error
github.com/snowflakedb/gosnowflake
../../../../go/pkg/mod/github.com/snowflakedb/gosnowflake@v1.7.0/s3_storage_client.go:105:3: cannot use out.ContentLength (variable of type *int64) as int64 value in struct literal
The text was updated successfully, but these errors were encountered: