diff --git a/CHANGELOG.md b/CHANGELOG.md index da44a67337..2ba0a1202d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ Changelog All notable changes to this project will be documented in this file. +## 4.42.0 - TBD + +### Added + +- Add support for `spanner` driver to SQL plugins. (@yufeng-deng) + ## 4.41.0 - 2024-11-25 ### Added diff --git a/internal/impl/snowflake/streaming/compat.go b/internal/impl/snowflake/streaming/compat.go index bb6b64a0d3..ab3c24aab5 100644 --- a/internal/impl/snowflake/streaming/compat.go +++ b/internal/impl/snowflake/streaming/compat.go @@ -98,7 +98,7 @@ func md5Hash(b []byte) string { // Generate the path for a blob when uploading to an internal snowflake table. // // Never change, this must exactly match the java SDK, don't think you can be fancy and change something. -func generateBlobPath(clientPrefix string, threadID, counter int) string { +func generateBlobPath(clientPrefix string, threadID, counter int64) string { now := time.Now().UTC() year := now.Year() month := int(now.Month()) diff --git a/internal/impl/snowflake/streaming/streaming.go b/internal/impl/snowflake/streaming/streaming.go index 2005f4f4a7..e3827ffbf5 100644 --- a/internal/impl/snowflake/streaming/streaming.go +++ b/internal/impl/snowflake/streaming/streaming.go @@ -395,8 +395,8 @@ func (c *SnowflakeIngestionChannel) InsertRows(ctx context.Context, batch servic startTime := time.Now() // Prevent multiple channels from having the same bdec file (it must be globally unique) // so add the ID of the channel in the upper 16 bits and then get 48 bits of randomness outside that. - fakeThreadID := (int(c.ID) << 48) | rand.N(1<<48) - blobPath := generateBlobPath(c.clientPrefix, fakeThreadID, int(c.requestIDCounter.Add(1))) + fakeThreadID := (int64(c.ID) << 48) | rand.Int64N(1<<48) + blobPath := generateBlobPath(c.clientPrefix, fakeThreadID, c.requestIDCounter.Add(1)) // This is extra metadata that is required for functionality in snowflake. c.fileMetadata["primaryFileId"] = path.Base(blobPath) part, err := c.constructBdecPart(batch, c.fileMetadata)