-
Notifications
You must be signed in to change notification settings - Fork 174
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
SNOW-1890076: SnowflakeConnectionV1#downloadStream has the chance of downloading the wrong file if files only differ by suffix. #2030
Comments
hi there and thanks for submitting this issue ! i think you're observing the expected and documented behaviour. Why? the Snowflake
This is precisely what is happening here. I think as it is the expected behaviour, considering a different approach
might help you. Hope this helps. |
The explanation makes sense but I don't agree with that this should be the behaviour. If As a first step, it'd be nice to have some kind of warning if you call What do you think about exposing the |
had a quick chat with the team about we'll take a look and i'll keep this thread posted on the progress. |
a PR is prepared with the fix : #2043 |
PR is merged and will be part of the next release |
Great news, thanks for the quick action @sfc-gh-dszmolka |
All credits go to my colleague @sfc-gh-dprzybysz but glad we could help you quickly :) |
change released with JDBC driver version 3.22.0 |
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of JDBC driver are you using?
3.21.0 but seems to be introduced in 3.19.1 by this PR: SNOW-1708304: Download stream from git repository #1920
What operating system and processor architecture are you using?
macOS ARM
What version of Java are you using?
17
What did you do?
I uploaded two files to my stage (not wrapped in quotes):
filename goes here
filename goes here.dat
Then, when I try to download
filename goes here
, I get the file content offilename goes here.dat
.Below is the code snippet that assumes
sourceFiles
should only ever contain a single filename when we calldownloadStream
. However,sourceFiles
is determined by applying some kind of parsing process to the CMD generated earlier (get '@"DPC_STREAMING_TESTING_DB"."CDC_IT_f3333863-c08f-4c9a-9dd2-6cd3c25465d2"."SNOWFLAKE_CLIENT_IT"/filename goes here' file:///tmp/ /*jdbc download stream*/
). In this example,sourceFiles
gets set to a list of both file names and in this case the list is ordered in a way not in my favor, so the wrong file is downloaded.File names sharing a name besides a prefix do not encounter this issue but filenames sharing a name besides a suffix do.
What did you expect to see?
I would expect the correct file to be downloaded.
The text was updated successfully, but these errors were encountered: