Skip to content
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

PUT command fails with ~ in file name #1458

Closed
koettert opened this issue Jun 29, 2023 · 1 comment · Fixed by #1481
Closed

PUT command fails with ~ in file name #1458

koettert opened this issue Jun 29, 2023 · 1 comment · Fixed by #1481
Assignees
Labels

Comments

@koettert
Copy link

On Windows it is possible to create a file path like this: C:/tmp/snowflake~\myfile.csv. When using this file path in the PUT command it fails since the driver replaces the ~ with the user home e.g. C:/tmp/snowflakeC:\User\Test\myfile.csv resulting in a file does not exists error. The problematic code is this: https://github.com/snowflakedb/snowflake-jdbc/blob/v3.13.33/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java#L1693

  1. What version of JDBC driver are you using?
    3.13.33 but also affects earlier versions

  2. What operating system and processor architecture are you using?
    Windows 10

  3. What version of Java are you using?
    JDK17

  4. What did you do?
    Tried to upload a file with ~ in the path name.

  5. What did you expect to see?
    That file would be uploaded

  6. Can you set logging to DEBUG and collect the logs?
    The used PUT command
    PUT 'file:///C:/tmp/snowflake~/knime_AP_20398_Snowfl_10693/snowflake-52197/knime2db8fbb59aee4534586.csv.gz' '@~' SOURCE_COMPRESSION=GZIP AUTO_COMPRESS=FALSE
    The exception that happened which shows the altered path name:

net.snowflake.client.jdbc.SnowflakeSQLLoggedException: File not found.
Cause: specified file does not exist: /C:/tmp/snowflakeC:\Users\Tobias/knime_AP_20398_Snowfl_10693/snowflake-52197/knime2db8fbb59aee4534586.csv.gz
Usage: to specify files, use "file://" prefix followed by path to files. A path can be relative or absolute. Example: put file:///tmp/bla* @table.
@koettert koettert added the bug label Jun 29, 2023
@sfc-gh-spanaite sfc-gh-spanaite self-assigned this Jun 29, 2023
@sfc-gh-spanaite sfc-gh-spanaite added the status-triage_needed This is a new issue, and initial triage is needed label Jun 29, 2023
@sfc-gh-spanaite
Copy link
Contributor

Hi @koettert I can easily reproduce this issue. Let me check internally what we can do about it.

@sfc-gh-spanaite sfc-gh-spanaite added In-Progress Issue to track for internal purpose and removed status-triage_needed This is a new issue, and initial triage is needed labels Jun 29, 2023
@sfc-gh-spanaite sfc-gh-spanaite removed the In-Progress Issue to track for internal purpose label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants