Reputation: 103
I have been trying to load a file into Snowflake using PUT but I am getting an error due to space in the folder name.
PUT file://Y:/AMI Control/file.csv @MS_FILE_LND
AUTO_COMPRESS=FALSE
I have tried using \ escape sequence and enclosing the entire path in quotes but it doesn't seem to be working.
Upvotes: 5
Views: 4258
Reputation: 131
The Windows version is incorrect. The correct PUT statement is:
PUT 'file://Y:/AMI Control/file.csv' @MS_FILE_LND AUTO_COMPRESS=FALSE
Snowflake documentation says:
"The URI can be enclosed in single quotes, which allows special characters, including spaces, in directory and file names; however, the drive and path separator is a forward slash (/) for all supported operating systems (e.g. 'file://C:/temp/load data' for a path in Windows containing a directory named load data)."
https://docs.snowflake.com/en/sql-reference/sql/put.html
Upvotes: 7
Reputation: 281
This would work
For Linux/Mac:
PUT 'file:///AMI Control/file.csv' @MS_FILE_LND AUTO_COMPRESS=FALSE
For Windows:
PUT 'file://Y:\AMI Control\file.csv' @MS_FILE_LND AUTO_COMPRESS=FALSE
Upvotes: 7