我正在嘗試將此雪花查詢寫入 Java 代碼:
copy into s3://snowflake171
from USER_TABLE
storage_integration = s3_int
file_format = CSV_TEST;
我是這樣寫的:
String q ="COPY INTO s3://snowflake171\n"
" FROM \"TEST\".\"PUBLIC\".\"USER_TABLE\"WHERE\"ID\\\"=?\"\n"
" storage_integration = s3_int\n"
" file_format = CSV_TEST";
但我收到此錯誤:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [COPY INTO s3://snowflake171
FROM "TEST"."PUBLIC"."USER_TABLE"WHERE"ID\"=?"
storage_integration = s3_int
file_format = CSV_TEST]; nested exception is net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error:
syntax error line 1 at position 5 unexpected '<EOF>'.
我錯過了什么?
uj5u.com熱心網友回復:
由于最新的錯誤訊息是“SQL 訪問控制錯誤:操作集成 'S3_INT' 的權限不足”,您可以嘗試將 s3_int 的 USAGE 權限授予您的角色嗎?您確定在連接時設定了正確的角色嗎?
String url = "jdbc:snowflake://<account_identifier>.snowflakecomputing.com";
Properties prop = new Properties();
prop.put("user", "<user>");
prop.put("privateKey", PrivateKeyReader.get(PRIVATE_KEY_FILE));
prop.put("db", "<database_name>");
prop.put("schema", "<schema_name>");
prop.put("warehouse", "<warehouse_name>");
prop.put("role", "<role_name>");
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/327556.html
上一篇:Postgres三月奇怪的結果
