Skip to content

Commit ec062e6

Browse files
sfc-gh-ggengclaude
andcommitted
[SNOW-3249917] JDBC removal Step 11d: Demote JDBC to test scope
- Change snowflake-jdbc-thin scope to test in pom.xml (used only by TestUtils.java for IT result verification) - Remove JDBC shade relocation rules from Maven Shade plugin JDBC is no longer shipped in the SDK jar. Zero net.snowflake.client code references in production code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f7107aa commit ec062e6

File tree

9 files changed

+2482
-32
lines changed

9 files changed

+2482
-32
lines changed

pom.xml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -887,11 +887,6 @@
887887
<groupId>net.minidev</groupId>
888888
<artifactId>json-smart</artifactId>
889889
</dependency>
890-
<!-- Snowflake JDBC used to connect to the service-->
891-
<dependency>
892-
<groupId>net.snowflake</groupId>
893-
<artifactId>snowflake-jdbc-thin</artifactId>
894-
</dependency>
895890
<dependency>
896891
<groupId>org.apache.commons</groupId>
897892
<artifactId>commons-lang3</artifactId>
@@ -1017,6 +1012,12 @@
10171012
<artifactId>junit</artifactId>
10181013
<scope>test</scope>
10191014
</dependency>
1015+
<!-- Snowflake JDBC — test scope only (used by TestUtils for IT result verification) -->
1016+
<dependency>
1017+
<groupId>net.snowflake</groupId>
1018+
<artifactId>snowflake-jdbc-thin</artifactId>
1019+
<scope>test</scope>
1020+
</dependency>
10201021
<dependency>
10211022
<groupId>org.assertj</groupId>
10221023
<artifactId>assertj-core</artifactId>
@@ -1514,14 +1515,7 @@
15141515
<pattern>com.nimbusds</pattern>
15151516
<shadedPattern>${shadeBase}.com.nimbusds</shadedPattern>
15161517
</relocation>
1517-
<relocation>
1518-
<pattern>net.snowflake.client</pattern>
1519-
<shadedPattern>${shadeBase}.net.snowflake.client</shadedPattern>
1520-
</relocation>
1521-
<relocation>
1522-
<pattern>com.snowflake.client.jdbc</pattern>
1523-
<shadedPattern>${shadeBase}.com.snowflake.client.jdbc</shadedPattern>
1524-
</relocation>
1518+
<!-- JDBC shade relocations removed — JDBC is now test-scope only -->
15251519
<relocation>
15261520
<pattern>org.bouncycastle</pattern>
15271521
<shadedPattern>${shadeBase}.org.bouncycastle</shadedPattern>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Replicated from snowflake-jdbc (v3.25.1)
3+
* Source: https://github.com/snowflakedb/snowflake-jdbc/blob/v3.25.1/src/main/java/net/snowflake/client/core/Constants.java
4+
*
5+
* Permitted differences: package declaration,
6+
* SnowflakeUtil.systemGetProperty -> StorageClientUtil.systemGetProperty.
7+
*/
8+
package net.snowflake.ingest.streaming.internal.fileTransferAgent;
9+
10+
import static net.snowflake.ingest.streaming.internal.fileTransferAgent.StorageClientUtil.systemGetProperty;
11+
12+
/*
13+
* Constants used in JDBC implementation
14+
*/
15+
public final class Constants {
16+
// Session expired error code as returned from Snowflake
17+
public static final int SESSION_EXPIRED_GS_CODE = 390112;
18+
19+
// Cloud storage credentials expired error code
20+
public static final int CLOUD_STORAGE_CREDENTIALS_EXPIRED = 240001;
21+
22+
// Session gone error code as returned from Snowflake
23+
public static final int SESSION_GONE = 390111;
24+
25+
// Error code for all invalid id token cases during login request
26+
public static final int ID_TOKEN_INVALID_LOGIN_REQUEST_GS_CODE = 390195;
27+
28+
public static final int OAUTH_ACCESS_TOKEN_EXPIRED_GS_CODE = 390318;
29+
30+
public static final int OAUTH_ACCESS_TOKEN_INVALID_GS_CODE = 390303;
31+
32+
// Error message for IOException when no space is left for GET
33+
public static final String NO_SPACE_LEFT_ON_DEVICE_ERR = "No space left on device";
34+
35+
public enum OS {
36+
WINDOWS,
37+
LINUX,
38+
MAC,
39+
SOLARIS
40+
}
41+
42+
private static OS os = null;
43+
44+
public static synchronized OS getOS() {
45+
if (os == null) {
46+
String operSys = systemGetProperty("os.name").toLowerCase();
47+
if (operSys.contains("win")) {
48+
os = OS.WINDOWS;
49+
} else if (operSys.contains("nix") || operSys.contains("nux") || operSys.contains("aix")) {
50+
os = OS.LINUX;
51+
} else if (operSys.contains("mac")) {
52+
os = OS.MAC;
53+
} else if (operSys.contains("sunos")) {
54+
os = OS.SOLARIS;
55+
}
56+
}
57+
return os;
58+
}
59+
60+
public static void clearOSForTesting() {
61+
os = null;
62+
}
63+
64+
public static final int MB = 1024 * 1024;
65+
public static final long GB = 1024 * 1024 * 1024;
66+
}

0 commit comments

Comments
 (0)