Skip to content

Commit

Permalink
Merge pull request #3034 from redpanda-data/ch
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwotj authored Nov 26, 2024
2 parents 015b7f2 + 8e96f2e commit 244e40d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/impl/snowflake/streaming/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions internal/impl/snowflake/streaming/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 244e40d

Please sign in to comment.