Skip to content

Commit

Permalink
Merge branch 'master' into SNOW-1213115-Move-test-categories-to-have-…
Browse files Browse the repository at this point in the history
…equal-distribution
  • Loading branch information
sfc-gh-pbulawa authored Sep 3, 2024
2 parents 7aa9050 + 107d370 commit 0ef35fe
Show file tree
Hide file tree
Showing 99 changed files with 4,200 additions and 1,847 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SNOW-XXXXX

1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

Fixes #NNNN
Issue: #NNNN


2. Fill out the following pre-review checklist:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ snowflake-whitelist
Golang
ClientTelemetryFramework
lib/*
.wiremock/**

# WhiteSource Scan
wss*.config
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
**JDBC Driver 3.19.0**

- \||Please Refer to Release Notes at https://docs.snowflake.com/en/release-notes/clients-drivers/jdbc

**JDBC Driver 3.18.0**

- \||Please Refer to Release Notes at https://docs.snowflake.com/en/release-notes/clients-drivers/jdbc

**JDBC Driver 3.17.0**

- \||Please Refer to Release Notes at https://docs.snowflake.com/en/release-notes/clients-drivers/jdbc
Expand Down
10 changes: 5 additions & 5 deletions FIPS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc-parent</artifactId>
<version>3.17.1-SNAPSHOT</version>
<version>3.19.0</version>
<relativePath>../parent-pom.xml</relativePath>
</parent>

<artifactId>snowflake-jdbc-fips</artifactId>
<version>3.17.1-SNAPSHOT</version>
<version>3.19.0</version>
<packaging>jar</packaging>

<name>snowflake-jdbc-fips</name>
Expand Down Expand Up @@ -133,15 +133,15 @@
</configuration>
</execution>
<execution>
<id>install-arrow-memory-netty</id>
<id>install-arrow-memory-netty-buffer-patch</id>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/../dependencies/arrow-memory-netty-${arrow.version}.jar</file>
<file>${basedir}/../dependencies/arrow-memory-netty-buffer-patch-${arrow.version}.jar</file>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<artifactId>arrow-memory-netty-buffer-patch</artifactId>
<version>${arrow.version}</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
Expand Down
14 changes: 7 additions & 7 deletions TestOnly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<arrow.version>10.0.1</arrow.version>
<arrow.version>17.0.0</arrow.version>
<awaitility.version>4.2.0</awaitility.version>
<jacksondatabind.version>2.13.4.2</jacksondatabind.version>
<jacksondatabind.version>2.17.2</jacksondatabind.version>
<jacoco.version>0.8.4</jacoco.version>
<jacoco.skip.instrument>true</jacoco.skip.instrument>
<jna.version>5.13.0</jna.version>
Expand All @@ -27,12 +27,12 @@
<dependency> <!-- netty is not a direct dependency. It is used by arrow-vector -->
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>4.1.77.Final</version>
<version>4.1.111.Final</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.1.77.Final</version>
<version>4.1.111.Final</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -165,7 +165,7 @@
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<artifactId>arrow-memory-netty-buffer-patch</artifactId>
<version>${arrow.version}</version>
<exclusions>
<exclusion> <!-- Exclude earlier version to avoid whitesource vulnerability. -->
Expand Down Expand Up @@ -285,13 +285,13 @@
</configuration>
</execution>
<execution>
<id>install-arrow-memory-netty</id>
<id>install-arrow-memory-netty-buffer-patch</id>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${project.basedir}/../dependencies/arrow-memory-netty-${arrow.version}.jar</file>
<file>${project.basedir}/../dependencies/arrow-memory-netty-buffer-patch-${arrow.version}.jar</file>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<version>${arrow.version}</version>
Expand Down
4 changes: 2 additions & 2 deletions dependencies/Readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Arrow dependencies are built from internal branch `upgradeTo10.0.1-v2`.
The artifacts should have version 10.0.2, but on maven central there is no higher version of arrow 10.x artifacts and maven build fails at the beginning of parsing pom, when dependencies are downloaded when we try to set higher version e.g. 10.0.2 so we need to keep old version `10.0.1` and let maven to download artifacts first and then we can replace them in the build process.
Arrow dependencies are built from internal branch `upgradeto17.0.0`. This build was applied the AIX fix.

Binary file removed dependencies/arrow-format-10.0.1.jar
Binary file not shown.
Binary file added dependencies/arrow-format-17.0.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-java-root</artifactId>
<version>10.0.1</version>
<version>17.0.0</version>
</parent>
<artifactId>arrow-memory</artifactId>
<name>Arrow Memory</name>
Expand All @@ -23,7 +23,7 @@
<modules>
<module>memory-core</module>
<module>memory-unsafe</module>
<module>memory-netty</module>
<module>memory-netty-buffer-patch</module>
</modules>

</project>
Binary file removed dependencies/arrow-memory-core-10.0.1.jar
Binary file not shown.
Binary file added dependencies/arrow-memory-core-17.0.0.jar
Binary file not shown.
Binary file removed dependencies/arrow-memory-netty-10.0.1.jar
Binary file not shown.
Binary file not shown.
Binary file removed dependencies/arrow-memory-unsafe-10.0.1.jar
Binary file not shown.
Binary file added dependencies/arrow-memory-unsafe-17.0.0.jar
Binary file not shown.
Binary file removed dependencies/arrow-vector-10.0.1.jar
Binary file not shown.
Binary file added dependencies/arrow-vector-17.0.0.jar
Binary file not shown.
35 changes: 23 additions & 12 deletions parent-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc-parent</artifactId>
<version>3.17.1-SNAPSHOT</version>
<version>3.19.0</version>
<packaging>pom</packaging>

<modules>
Expand All @@ -19,11 +19,11 @@
<apache.commons.text.version>1.10.0</apache.commons.text.version>
<apache.httpclient.version>4.5.14</apache.httpclient.version>
<apache.httpcore.version>4.4.16</apache.httpcore.version>
<arrow.version>10.0.1</arrow.version>
<arrow.version>17.0.0</arrow.version>
<asm.version>9.3</asm.version>
<avro.version>1.8.1</avro.version>
<awaitility.version>4.2.0</awaitility.version>
<awssdk.version>1.12.501</awssdk.version>
<awssdk.version>1.12.655</awssdk.version>
<azure.storage.version>5.0.0</azure.storage.version>
<bouncycastle.version>1.74</bouncycastle.version>
<bouncycastle.bcfips.version>1.0.2.4</bouncycastle.bcfips.version>
Expand All @@ -32,7 +32,7 @@
<classworlds.version>1.1</classworlds.version>
<checkerframework.version>3.33.0</checkerframework.version>
<commons.cli.version>1.2</commons.cli.version>
<commons.codec.version>1.15</commons.codec.version>
<commons.codec.version>1.17.0</commons.codec.version>
<commons.dbcp.version>1.4</commons.dbcp.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.logging.version>1.2</commons.logging.version>
Expand All @@ -44,7 +44,7 @@
<google.cloud.storage.version>2.22.6</google.cloud.storage.version>
<google.code.gson.version>2.10.1</google.code.gson.version>
<google.errorprone.version>2.18.0</google.errorprone.version>
<google.flatbuffers.version>1.12.0</google.flatbuffers.version>
<google.flatbuffers.version>24.3.25</google.flatbuffers.version>
<google.gax.version>2.31.0</google.gax.version>
<google.guava.version>32.1.1-jre</google.guava.version>
<google.http.client.version>1.43.3</google.http.client.version>
Expand All @@ -53,7 +53,7 @@
<grpc.version>1.60.0</grpc.version>
<hamcrest.version>2.2</hamcrest.version>
<hikaricp.version>2.4.3</hikaricp.version>
<jackson.version>2.15.3</jackson.version>
<jackson.version>2.17.2</jackson.version>
<jacoco.skip.instrument>true</jacoco.skip.instrument>
<javax.servlet.version>3.1.0</javax.servlet.version>
<jna.version>5.13.0</jna.version>
Expand All @@ -73,10 +73,10 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<relocationBase>net/snowflake/client/jdbc/internal</relocationBase>
<shadeBase>net.snowflake.client.jdbc.internal</shadeBase>
<slf4j.version>2.0.6</slf4j.version>
<slf4j.version>2.0.13</slf4j.version>
<snowflake.common.version>5.1.4</snowflake.common.version>
<testCategory>net.snowflake.client.category.AllTestCategory</testCategory>
<threeten.version>1.6.8</threeten.version>
<threeten.version>1.6.9</threeten.version>
<tika.version>2.4.1</tika.version>
<tukaani.version>1.9</tukaani.version>
<version.maven>3.6.3</version.maven>
Expand All @@ -94,14 +94,15 @@
<version.plugin.gpg>3.0.1</version.plugin.gpg>
<version.plugin.install>3.1.1</version.plugin.install>
<version.plugin.jacoco>0.8.8</version.plugin.jacoco>
<version.plugin.japicmp>0.17.2</version.plugin.japicmp>
<version.plugin.japicmp>0.23.0</version.plugin.japicmp>
<version.plugin.jar>3.3.0</version.plugin.jar>
<version.plugin.javadoc>3.5.0</version.plugin.javadoc>
<version.plugin.projectinforeports>3.4.2</version.plugin.projectinforeports>
<version.plugin.shade>3.4.1</version.plugin.shade>
<version.plugin.shade>3.6.0</version.plugin.shade>
<version.plugin.sortpom>3.0.1</version.plugin.sortpom>
<version.plugin.source>3.2.1</version.plugin.source>
<version.plugin.surefire>3.0.0</version.plugin.surefire>
<version.plugin.wiremock>3.8.0</version.plugin.wiremock>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -401,7 +402,7 @@
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<artifactId>arrow-memory-netty-buffer-patch</artifactId>
<version>${arrow.version}</version>
<scope>runtime</scope>
</dependency>
Expand Down Expand Up @@ -507,6 +508,12 @@
<version>${version.plugin.surefire}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>${version.plugin.wiremock}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -673,7 +680,7 @@
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<artifactId>arrow-memory-netty-buffer-patch</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
Expand Down Expand Up @@ -757,5 +764,9 @@
<groupId>org.apache.maven.surefire</groupId>
<artifactId>common-junit48</artifactId>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
</dependency>
</dependencies>
</project>
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc-parent</artifactId>
<version>3.17.1-SNAPSHOT</version>
<version>3.19.0</version>
<relativePath>./parent-pom.xml</relativePath>
</parent>

<!-- Maven complains about using property here, but it makes install and deploy process easier to override final package names and localization -->
<artifactId>${artifactId}</artifactId>
<version>3.17.1-SNAPSHOT</version>
<version>3.19.0</version>
<packaging>jar</packaging>

<name>${artifactId}</name>
Expand Down Expand Up @@ -401,15 +401,15 @@
</configuration>
</execution>
<execution>
<id>install-arrow-memory-netty</id>
<id>install-arrow-memory-netty-buffer-patch</id>
<goals>
<goal>install-file</goal>
</goals>
<phase>validate</phase>
<configuration>
<file>${project.basedir}/dependencies/arrow-memory-netty-${arrow.version}.jar</file>
<file>${project.basedir}/dependencies/arrow-memory-netty-buffer-patch-${arrow.version}.jar</file>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
<artifactId>arrow-memory-netty-buffer-patch</artifactId>
<version>${arrow.version}</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
Expand Down Expand Up @@ -1026,21 +1026,21 @@
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/19/${relocationBase}"/>
<mkdir dir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/>
<!-- org.bouncycastle.* packages are relocated to ${relocationBase}.org.bouncycastle.* -->
<move file="${project.build.directory}/relocate/META-INF/versions/9/org" todir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/11/org" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/15/org" todir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
<!-- com.fasterxml.* packages are relocated to ${relocationBase}.fasterxml.* -->
<move file="${project.build.directory}/relocate/META-INF/versions/11/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/17/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/19/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/19/${relocationBase}"/>
<move file="${project.build.directory}/relocate/META-INF/versions/21/com/fasterxml" todir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/>
<zip basedir="${project.build.directory}/relocate" destfile="${project.build.directory}/${project.build.finalName}.jar"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/9/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/11/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/15/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/17/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/19/${relocationBase}"/>
<delete dir="${project.build.directory}/relocate/META-INF/versions/21/${relocationBase}"/>
</target>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ private static Map<String, Map> readParametersMap(Path configFilePath)
throws SnowflakeSQLException {
try {
File file = new File(configFilePath.toUri());
varifyFilePermissionSecure(configFilePath);
verifyFilePermissionSecure(configFilePath);
return mapper.readValue(file, Map.class);
} catch (IOException ex) {
throw new SnowflakeSQLException(ex, "Problem during reading a configuration file.");
}
}

private static void varifyFilePermissionSecure(Path configFilePath)
private static void verifyFilePermissionSecure(Path configFilePath)
throws IOException, SnowflakeSQLException {
if (Constants.getOS() != Constants.OS.WINDOWS) {
PosixFileAttributeView posixFileAttributeView =
Expand All @@ -78,10 +78,11 @@ private static void varifyFilePermissionSecure(Path configFilePath)
Arrays.asList(PosixFilePermission.OWNER_WRITE, PosixFilePermission.OWNER_READ)
.contains(o))) {
logger.error(
"Reading from file {} is not safe because of insufficient permissions", configFilePath);
"Reading from file %s is not safe because file permissions are different than read/write for user",
configFilePath);
throw new SnowflakeSQLException(
String.format(
"Reading from file %s is not safe because of insufficient permissions",
"Reading from file %s is not safe because file permissions are different than read/write for user",
configFilePath));
}
}
Expand All @@ -108,13 +109,14 @@ public static ConnectionParameters buildConnectionParameters() throws SnowflakeS
.orElse(SNOWFLAKE_TOKEN_FILE_PATH));
logger.debug("Token used in connect is read from file: {}", path);
try {
verifyFilePermissionSecure(path);
String token = new String(Files.readAllBytes(path), Charset.defaultCharset());
if (!token.isEmpty()) {
putPropertyIfNotNull(conectionProperties, "token", token.trim());
} else {
logger.warn("The token has empty value");
}
} catch (IOException ex) {
} catch (Exception ex) {
throw new SnowflakeSQLException(ex, "There is a problem during reading token from file");
}
}
Expand Down
Loading

0 comments on commit 0ef35fe

Please sign in to comment.