Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/test/java/net/snowflake/client/jdbc/SnowflakeDriverIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -2736,6 +2736,7 @@ public void testPutGetToUnencryptedStage() throws Throwable {
accountName = "gcpaccount";
SnowflakeUtil.systemSetEnv("SNOWFLAKE_GCS_FORCE_VIRTUAL_STYLE_DOMAINS", "true");
}
String stageName = "testPutGet_unencstage_" + SnowflakeUtil.randomAlphaNumeric(10);
try (Connection connection = getConnection(accountName);
Statement statement = connection.createStatement()) {
try {
Expand All @@ -2748,18 +2749,18 @@ public void testPutGetToUnencryptedStage() throws Throwable {

statement.execute("alter session set ENABLE_GCP_PUT_EXCEPTION_FOR_OLD_DRIVERS=false");
statement.execute(
"CREATE OR REPLACE STAGE testPutGet_unencstage encryption=(TYPE='SNOWFLAKE_SSE')");
"CREATE OR REPLACE STAGE " + stageName + " encryption=(TYPE='SNOWFLAKE_SSE')");

assertTrue(
statement.execute("PUT file://" + sourceFilePath + " @testPutGet_unencstage"),
statement.execute("PUT file://" + sourceFilePath + " @" + stageName),
"Failed to put a file");

findFile(statement, "ls @testPutGet_unencstage/");
findFile(statement, "ls @" + stageName + "/");

// download the file we just uploaded to stage
assertTrue(
statement.execute(
"GET @testPutGet_unencstage 'file://" + destFolderCanonicalPath + "' parallel=8"),
"GET @" + stageName + " 'file://" + destFolderCanonicalPath + "' parallel=8"),
"Failed to get a file");

// Make sure that the downloaded file exists, it should be gzip compressed
Expand All @@ -2775,7 +2776,7 @@ public void testPutGetToUnencryptedStage() throws Throwable {
File unzipped = new File(destFolderCanonicalPathWithSeparator + TEST_DATA_FILE);
assertEquals(original.length(), unzipped.length());
} finally {
statement.execute("DROP STAGE IF EXISTS testPutGet_unencstage");
statement.execute("DROP STAGE IF EXISTS " + stageName);
}
} finally {
SnowflakeUtil.systemSetEnv("SNOWFLAKE_GCS_FORCE_VIRTUAL_STYLE_DOMAINS", "false");
Expand Down
Loading