-
Notifications
You must be signed in to change notification settings - Fork 832
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
snowflake: introduce new output based on snowpipe streaming #2926
Draft
rockwotj
wants to merge
43
commits into
main
Choose a base branch
from
snowpipe
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,308
−45
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emaxerrno
reviewed
Oct 9, 2024
rockwotj
force-pushed
the
snowpipe
branch
2 times, most recently
from
October 10, 2024 17:52
641f7fc
to
962aefa
Compare
rockwotj
changed the title
snowflake: introduce new snowflake output based on snowpipe streaming
snowflake: introduce new output based on snowpipe streaming
Oct 11, 2024
rockwotj
force-pushed
the
snowpipe
branch
8 times, most recently
from
October 16, 2024 14:55
ccfb3b2
to
fcf9521
Compare
An example being recomputing/refreshing authentication tokens
This is the initial (buggy, incomplete) port of Snowpipe Streaming SDK from Java into Golang for usage in Redpanda Connect. Product Docs: https://docs.snowflake.com/en/user-guide/data-load-snowpipe-streaming-overview Java SDK: https://github.com/snowflakedb/snowflake-ingest-java/tree/master/src/main/java/net/snowflake/ingest/streaming Code Deep Dive: https://blog.yuvalitzchakov.com/snowpipe-streaming-deep-dive/
Probably need a way to cancel pending HTTP requests in the configureClient request..
Just tidying things up
That ended up working out very nicely, and now we can properly shutdown quickly.
This optimizes a pass over the batch if the user doesn't have a mapping
With timestamps and such we're going to need to know extra parameters let's just make this a proper interface and struct
Java uses an actual thread ID, we'll just generate a randomized one
And add an integration test
Currently fails due to an unknown reason I'm investigating
Also fix linter errors with unused stuff
until we fix numbers
Also add a specific integration test to debug the SB16 issues
The underlying scanner does this and we need to match otherwise we'll misalign expectations.
These are SB* physical column, which is subject to the column size optimization.
So this commit adds support for scale!=0 in Int128 values, this is important for supporting all possible numeric values in snowflake, but this is a narly bit of math here. All the code here is adapted from the apache arrow project (licensing is properly attributed) with some light fixes around edge cases. I will attempt to upstream this and our bug fixes/perf improvements to the arrow project so we don't have to maintain this code forever. If that happens we can take a dependency on apache arrow go and drop this int128 package in our tree.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a port to Golang of Snowpipe Streaming. The only existing implementation is here and in Java. For more information about the Java implementation, check out this deep dive someone published.
The SDK we have here is architecturally much simpler - as the connect framework handles a lot of the complexity around batching, retries, etc. This SDK is then hooked up into an
output
so it can be leveraged in Redpanda Connect.IMPLEMENTATION NOTES:
compat.go
and is unit tested to prove exact output compared to the Java implementation (and the constants there are derived from debugging the original Java source).