SnowflakeConnectionV1#downloadStream has the chance of downloading the wrong file if files only differ by suffix. #2030
Labels
question
Issue is a usage/other question rather than a bug
status-triage_done
Initial triage done, will be further handled by the driver team
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: