我正在使用 SpringBoot 和 Java 將資料從表復制Snowflake到S3 bucket.
我正在使用此代碼:
"COPY INTO s3://snowflake/" userId " from \"TEST\".\"PUBLIC\".\"USER_TABLE_TEMP\" storage_integration = s3_int file_format = CSV_TEST;";
它有效。我將 userId 作為檔案的前綴。
它不起作用的是當我嘗試為同一用戶復制資料時,對于該.csv檔案已存在于存盤桶中的用戶。
當我嘗試這樣做時,我收到此錯誤:
Files already existing at the unload destination: s3://snowflake/1. Use overwrite option to force unloading.
我怎樣才能使這個作業,以便新檔案覆寫舊檔案?
uj5u.com熱心網友回復:
您必須使用 OVERWRITE 引數并在 COPY 命令中將其設定為 true。
檔案:https : //docs.snowflake.com/en/sql-reference/sql/copy-into-location.html#copy-options-copyoptions
所以宣告是..
COPY INTO ...
file_format = CSV_TEST
OVERWRITE=TRUE;
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/352758.html
標籤:爪哇 亚马逊网络服务 弹簧靴 亚马逊-s3 雪花云数据平台
