diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 97d27c1a9..84ae71dcc 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -2,9 +2,12 @@
SNOW-XXXXX
-## External contributors - please answer these questions before submitting a pull request. Thanks!
+## Pre-review self checklist
+- [ ] The code is correctly formatted (run `mvn -P check-style validate`)
+- [ ] I don't expose unnecessary new public API (run `mvn verify` and inspect `target/japicmp/japicmp.html`)
+- [ ] Pull request name is prefixed with `SNOW-XXXX: `
-Please answer these questions before submitting your pull requests. Thanks!
+## External contributors - please answer these questions before submitting a pull request. Thanks!
1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
@@ -18,13 +21,9 @@ Please answer these questions before submitting your pull requests. Thanks!
- [ ] I am modifying authorization mechanisms
- [ ] I am adding new credentials
- [ ] I am modifying OCSP code
- - [ ] I am adding a new dependency
+ - [ ] I am adding a new dependency or upgrading an existing one
+ - [ ] I am adding new public/protected component not marked with `@SnowflakeJdbcInternalApi` (note that public/protected methods/fields in classes marked with this annotation are already internal)
3. Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.
-
-## Pre-review checklist
-- [ ] This change has passed precommit
-- [ ] I have reviewed code coverage report for my PR in ([Sonarqube](https://sonarqube.int.snowflakecomputing.com/project/branches?id=snowflake-jdbc))
-
diff --git a/.github/workflows/check-style.yml b/.github/workflows/check-style.yml
index 7b712cf73..221651298 100644
--- a/.github/workflows/check-style.yml
+++ b/.github/workflows/check-style.yml
@@ -12,4 +12,4 @@ jobs:
- uses: actions/checkout@v1
- name: Check Style
shell: bash
- run: mvn clean verify --batch-mode --show-version -P check-style
+ run: mvn clean validate --batch-mode --show-version -P check-style
diff --git a/FIPS/pom.xml b/FIPS/pom.xml
index e7b0f6ccf..e3177ea96 100644
--- a/FIPS/pom.xml
+++ b/FIPS/pom.xml
@@ -5,12 +5,12 @@
net.snowflake
snowflake-jdbc-parent
- 3.14.5
+ 3.14.6-SNAPSHOT
../parent-pom.xml
snowflake-jdbc-fips
- 3.14.5
+ 3.14.6-SNAPSHOT
jar
snowflake-jdbc-fips
diff --git a/README.rst b/README.rst
index ae38c2a67..55248b392 100644
--- a/README.rst
+++ b/README.rst
@@ -138,7 +138,7 @@ Run the maven command to check the coding style.
.. code-block:: bash
- mvn -P check-style verify
+ mvn -P check-style validate
Follow the instruction if any error occurs or run this command to fix the formats.
@@ -151,6 +151,10 @@ You may import the coding style from IntelliJ so that the coding style can be ap
- In the **File** -> **Settings/Plugins**, and install `google-java-format` plugin.
- Enable `google-java-format` for the JDBC project.
- In the source code window, select **Code** -> **Reformat** to apply the coding style.
+- Additionally configure IDE to not use wildcard imports in **File** -> **Ecitor** -> **Code Style** -> **Java** set:
+ - **Use single class import**
+ - **Class count to use import with '*'** to 1000
+ - **Names count to use static import with '*'** to 1000
Tests
=====
@@ -179,6 +183,18 @@ Run the maven ``verify`` goal.
where ``category`` is the class name under the package ``net.snowflake.client.category``.
+Set new version
+---------------
+
+1. Run maven command with passing specific version:
+
+.. code-block:: bash
+
+ mvn -f parent-pom.xml versions:set -DnewVersion=... -DgenerateBackupPoms=false
+
+2. Set manually the same version in field ``implementVersion`` in ``src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java`` when it's version for release or without ``-SNAPSHOT`` suffix between releases
+3. Add entry in ``CHANGELOG.rst`` for release versions
+
Test Class Naming Convention
----------------------------
diff --git a/parent-pom.xml b/parent-pom.xml
index bc9ebdfc8..b7a553564 100644
--- a/parent-pom.xml
+++ b/parent-pom.xml
@@ -5,9 +5,14 @@
net.snowflake
snowflake-jdbc-parent
- 3.14.5
+ 3.14.6-SNAPSHOT
pom
+
+ .
+ FIPS
+
+
1.21
3.12.0
@@ -74,6 +79,7 @@
3.6.3
3.1.0
3.0.0
+ 3.3.1
3.2.0
3.11.0
3.5.0
diff --git a/pom.xml b/pom.xml
index 146b1367f..a10aec4a1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,13 +6,13 @@
net.snowflake
snowflake-jdbc-parent
- 3.14.5
+ 3.14.6-SNAPSHOT
./parent-pom.xml
${artifactId}
- 3.14.5
+ 3.14.6-SNAPSHOT
jar
${artifactId}
@@ -68,6 +68,11 @@
maven-antrun-plugin
${version.plugin.antrun}
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ ${version.plugin.checkstyle}
+
org.apache.maven.plugins
maven-clean-plugin
@@ -185,14 +190,15 @@
japicmp-maven-plugin
- true
- true
+ true
+ false
\d+\.\d+\.\d+
com.snowflake
net.snowflake
+ @net.snowflake.client.core.SnowflakeJdbcInternalApi
${shadeBase}
@@ -573,9 +579,37 @@
fmt-maven-plugin
+ fmt
+
+ check
+
+ validate
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+
+
+
+
+
+
+
+
+ true
+ true
+ true
+ warning
+
+
+
+ checkstyle
check
+ validate
@@ -594,20 +628,6 @@
-
-
- com.github.siom79.japicmp
- japicmp-maven-plugin
-
-
- japicmp
-
- cmp
-
- none
-
-
-
org.apache.maven.plugins
diff --git a/src/main/java/net/snowflake/client/core/Event.java b/src/main/java/net/snowflake/client/core/Event.java
index cd3bddaf8..e9e5400a6 100644
--- a/src/main/java/net/snowflake/client/core/Event.java
+++ b/src/main/java/net/snowflake/client/core/Event.java
@@ -5,7 +5,11 @@
package net.snowflake.client.core;
import com.google.common.base.Preconditions;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
import java.util.zip.GZIPOutputStream;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
diff --git a/src/main/java/net/snowflake/client/core/EventHandler.java b/src/main/java/net/snowflake/client/core/EventHandler.java
index cca435386..11acd00fa 100644
--- a/src/main/java/net/snowflake/client/core/EventHandler.java
+++ b/src/main/java/net/snowflake/client/core/EventHandler.java
@@ -6,10 +6,20 @@
import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TimeZone;
+import java.util.TreeSet;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
diff --git a/src/main/java/net/snowflake/client/core/FileCacheManager.java b/src/main/java/net/snowflake/client/core/FileCacheManager.java
index becfa3c4a..e635796c0 100644
--- a/src/main/java/net/snowflake/client/core/FileCacheManager.java
+++ b/src/main/java/net/snowflake/client/core/FileCacheManager.java
@@ -9,7 +9,14 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
diff --git a/src/main/java/net/snowflake/client/core/HttpUtil.java b/src/main/java/net/snowflake/client/core/HttpUtil.java
index 62307257c..055db1c66 100644
--- a/src/main/java/net/snowflake/client/core/HttpUtil.java
+++ b/src/main/java/net/snowflake/client/core/HttpUtil.java
@@ -12,8 +12,11 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.microsoft.azure.storage.OperationContext;
-import com.snowflake.client.jdbc.SnowflakeDriver;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.Socket;
@@ -29,6 +32,7 @@
import javax.net.ssl.TrustManager;
import net.snowflake.client.jdbc.ErrorCode;
import net.snowflake.client.jdbc.RestRequest;
+import net.snowflake.client.jdbc.SnowflakeDriver;
import net.snowflake.client.jdbc.SnowflakeSQLException;
import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.client.jdbc.cloud.storage.S3HttpUtil;
@@ -109,14 +113,14 @@ public class HttpUtil {
@SnowflakeJdbcInternalApi
public static Duration getConnectionTimeout() {
return Duration.ofMillis(
- convertSystemPropertyToIntValue(
+ SystemUtil.convertSystemPropertyToIntValue(
JDBC_CONNECTION_TIMEOUT_IN_MS_PROPERTY, DEFAULT_HTTP_CLIENT_CONNECTION_TIMEOUT_IN_MS));
}
@SnowflakeJdbcInternalApi
public static Duration getSocketTimeout() {
return Duration.ofMillis(
- convertSystemPropertyToIntValue(
+ SystemUtil.convertSystemPropertyToIntValue(
JDBC_SOCKET_TIMEOUT_IN_MS_PROPERTY, DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT_IN_MS));
}
@@ -258,7 +262,7 @@ public static CloseableHttpClient buildHttpClient(
@Nullable HttpClientSettingsKey key, File ocspCacheFile, boolean downloadUnCompressed) {
// set timeout so that we don't wait forever.
// Setup the default configuration for all requests on this client
- int timeToLive = convertSystemPropertyToIntValue(JDBC_TTL, DEFAULT_TTL);
+ int timeToLive = SystemUtil.convertSystemPropertyToIntValue(JDBC_TTL, DEFAULT_TTL);
logger.debug("time to live in connection pooling manager: {}", timeToLive);
long connectTimeout = getConnectionTimeout().toMillis();
long socketTimeout = getSocketTimeout().toMillis();
@@ -326,9 +330,10 @@ public static CloseableHttpClient buildHttpClient(
new PoolingHttpClientConnectionManager(
registry, null, null, null, timeToLive, TimeUnit.SECONDS);
int maxConnections =
- convertSystemPropertyToIntValue(JDBC_MAX_CONNECTIONS_PROPERTY, DEFAULT_MAX_CONNECTIONS);
+ SystemUtil.convertSystemPropertyToIntValue(
+ JDBC_MAX_CONNECTIONS_PROPERTY, DEFAULT_MAX_CONNECTIONS);
int maxConnectionsPerRoute =
- convertSystemPropertyToIntValue(
+ SystemUtil.convertSystemPropertyToIntValue(
JDBC_MAX_CONNECTIONS_PER_ROUTE_PROPERTY, DEFAULT_MAX_CONNECTIONS_PER_ROUTE);
logger.debug(
"Max connections total in connection pooling manager: {}; max connections per route: {}",
@@ -854,29 +859,6 @@ public Socket createSocket(HttpContext ctx) throws IOException {
}
}
- /**
- * Helper function to convert system properties to integers
- *
- * @param systemProperty name of the system property
- * @param defaultValue default value used
- * @return the value of the system property, else the default value
- */
- static int convertSystemPropertyToIntValue(String systemProperty, int defaultValue) {
- String systemPropertyValue = systemGetProperty(systemProperty);
- int returnVal = defaultValue;
- if (systemPropertyValue != null) {
- try {
- returnVal = Integer.parseInt(systemPropertyValue);
- } catch (NumberFormatException ex) {
- logger.info(
- "Failed to parse the system parameter {} with value {}",
- systemProperty,
- systemPropertyValue);
- }
- }
- return returnVal;
- }
-
/**
* Helper function to attach additional headers to a request if present. This takes a (nullable)
* map of headers in format and adds them to the incoming request using addHeader.
diff --git a/src/main/java/net/snowflake/client/core/IncidentUtil.java b/src/main/java/net/snowflake/client/core/IncidentUtil.java
index 6b2086ee5..0506f159b 100644
--- a/src/main/java/net/snowflake/client/core/IncidentUtil.java
+++ b/src/main/java/net/snowflake/client/core/IncidentUtil.java
@@ -14,7 +14,11 @@
import com.yammer.metrics.core.Clock;
import com.yammer.metrics.core.VirtualMachineMetrics;
import com.yammer.metrics.reporting.MetricsServlet;
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPOutputStream;
diff --git a/src/main/java/net/snowflake/client/core/ObjectMapperFactory.java b/src/main/java/net/snowflake/client/core/ObjectMapperFactory.java
index d93fc3b52..c751d4d20 100644
--- a/src/main/java/net/snowflake/client/core/ObjectMapperFactory.java
+++ b/src/main/java/net/snowflake/client/core/ObjectMapperFactory.java
@@ -1,5 +1,6 @@
package net.snowflake.client.core;
+import com.fasterxml.jackson.core.StreamReadConstraints;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -8,11 +9,27 @@
* by this method.
*/
public class ObjectMapperFactory {
+ @SnowflakeJdbcInternalApi
+ // Snowflake allows up to 16M string size and returns base64 encoded value that makes it up to 23M
+ public static final int DEFAULT_MAX_JSON_STRING_LEN = 23_000_000;
+
+ @SnowflakeJdbcInternalApi
+ public static final String MAX_JSON_STRING_LENGTH_JVM =
+ "net.snowflake.jdbc.objectMapper.maxJsonStringLength";
+
public static ObjectMapper getObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS, false);
mapper.configure(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS, false);
+ // override the maxStringLength value in ObjectMapper
+ int maxJsonStringLength =
+ SystemUtil.convertSystemPropertyToIntValue(
+ MAX_JSON_STRING_LENGTH_JVM, DEFAULT_MAX_JSON_STRING_LEN);
+ mapper
+ .getFactory()
+ .setStreamReadConstraints(
+ StreamReadConstraints.builder().maxStringLength(maxJsonStringLength).build());
return mapper;
}
}
diff --git a/src/main/java/net/snowflake/client/core/QueryContextCache.java b/src/main/java/net/snowflake/client/core/QueryContextCache.java
index cddf33e32..ea6e37cd5 100644
--- a/src/main/java/net/snowflake/client/core/QueryContextCache.java
+++ b/src/main/java/net/snowflake/client/core/QueryContextCache.java
@@ -7,7 +7,12 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
diff --git a/src/main/java/net/snowflake/client/core/ResultUtil.java b/src/main/java/net/snowflake/client/core/ResultUtil.java
index 65730ff33..f973bb1b1 100644
--- a/src/main/java/net/snowflake/client/core/ResultUtil.java
+++ b/src/main/java/net/snowflake/client/core/ResultUtil.java
@@ -10,7 +10,14 @@
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
import net.snowflake.client.jdbc.ErrorCode;
import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.client.log.ArgSupplier;
diff --git a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java
index 5a121086a..ce83befd0 100644
--- a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java
+++ b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java
@@ -16,8 +16,12 @@
import java.sql.Timestamp;
import java.util.TimeZone;
import net.snowflake.client.core.arrow.ArrowVectorConverter;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ArrowResultChunk;
import net.snowflake.client.jdbc.ArrowResultChunk.ArrowChunkIterator;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
import net.snowflake.client.jdbc.telemetry.Telemetry;
import net.snowflake.client.jdbc.telemetry.TelemetryData;
import net.snowflake.client.jdbc.telemetry.TelemetryField;
diff --git a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java
index 0cf4ac568..8901598b8 100644
--- a/src/main/java/net/snowflake/client/core/SFBaseResultSet.java
+++ b/src/main/java/net/snowflake/client/core/SFBaseResultSet.java
@@ -9,7 +9,11 @@
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
import net.snowflake.client.jdbc.ErrorCode;
import net.snowflake.client.jdbc.SnowflakeResultSetSerializable;
import net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1;
diff --git a/src/main/java/net/snowflake/client/core/SFBaseSession.java b/src/main/java/net/snowflake/client/core/SFBaseSession.java
index 810ce0398..a5b63974d 100644
--- a/src/main/java/net/snowflake/client/core/SFBaseSession.java
+++ b/src/main/java/net/snowflake/client/core/SFBaseSession.java
@@ -10,10 +10,19 @@
import com.google.common.base.Strings;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.QueryStatusV2;
+import net.snowflake.client.jdbc.SFConnectionHandler;
+import net.snowflake.client.jdbc.SnowflakeConnectString;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeType;
import net.snowflake.client.jdbc.telemetry.Telemetry;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
diff --git a/src/main/java/net/snowflake/client/core/SFFixedViewResultSet.java b/src/main/java/net/snowflake/client/core/SFFixedViewResultSet.java
index 671857b93..b3f797f6f 100644
--- a/src/main/java/net/snowflake/client/core/SFFixedViewResultSet.java
+++ b/src/main/java/net/snowflake/client/core/SFFixedViewResultSet.java
@@ -7,8 +7,13 @@
import java.sql.SQLException;
import java.util.List;
import net.snowflake.client.core.json.Converters;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.SFBaseFileTransferAgent;
import net.snowflake.client.jdbc.SFBaseFileTransferAgent.CommandType;
+import net.snowflake.client.jdbc.SnowflakeFixedView;
+import net.snowflake.client.jdbc.SnowflakeLoggedFeatureNotSupportedException;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.common.core.SFBinaryFormat;
diff --git a/src/main/java/net/snowflake/client/core/SFResultSet.java b/src/main/java/net/snowflake/client/core/SFResultSet.java
index 3a32dde6b..77f30ddd7 100644
--- a/src/main/java/net/snowflake/client/core/SFResultSet.java
+++ b/src/main/java/net/snowflake/client/core/SFResultSet.java
@@ -13,7 +13,12 @@
import java.util.Comparator;
import net.snowflake.client.core.BasicEvent.QueryState;
import net.snowflake.client.core.json.Converters;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.JsonResultChunk;
+import net.snowflake.client.jdbc.SnowflakeResultChunk;
+import net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
import net.snowflake.client.jdbc.telemetry.Telemetry;
import net.snowflake.client.jdbc.telemetry.TelemetryData;
import net.snowflake.client.jdbc.telemetry.TelemetryField;
diff --git a/src/main/java/net/snowflake/client/core/SFResultSetMetaData.java b/src/main/java/net/snowflake/client/core/SFResultSetMetaData.java
index 1ebe3ca1d..2976473ac 100644
--- a/src/main/java/net/snowflake/client/core/SFResultSetMetaData.java
+++ b/src/main/java/net/snowflake/client/core/SFResultSetMetaData.java
@@ -7,7 +7,12 @@
import java.sql.Date;
import java.sql.ResultSetMetaData;
import java.sql.Types;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
import net.snowflake.client.jdbc.ErrorCode;
import net.snowflake.client.jdbc.SnowflakeColumnMetadata;
import net.snowflake.client.jdbc.SnowflakeUtil;
diff --git a/src/main/java/net/snowflake/client/core/SFSession.java b/src/main/java/net/snowflake/client/core/SFSession.java
index be7f3e539..f93f29492 100644
--- a/src/main/java/net/snowflake/client/core/SFSession.java
+++ b/src/main/java/net/snowflake/client/core/SFSession.java
@@ -4,7 +4,9 @@
package net.snowflake.client.core;
-import static net.snowflake.client.core.QueryStatus.*;
+import static net.snowflake.client.core.QueryStatus.getStatusFromString;
+import static net.snowflake.client.core.QueryStatus.isAnError;
+import static net.snowflake.client.core.QueryStatus.isStillRunning;
import static net.snowflake.client.core.SFLoginInput.getBooleanValue;
import com.fasterxml.jackson.databind.JsonNode;
@@ -15,12 +17,29 @@
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
import java.time.Duration;
-import java.util.*;
-import java.util.concurrent.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import net.snowflake.client.config.SFClientConfig;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.DefaultSFConnectionHandler;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.QueryStatusV2;
+import net.snowflake.client.jdbc.SnowflakeConnectString;
+import net.snowflake.client.jdbc.SnowflakeReauthenticationRequest;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.client.jdbc.telemetry.Telemetry;
import net.snowflake.client.jdbc.telemetry.TelemetryClient;
import net.snowflake.client.jdbc.telemetryOOB.TelemetryService;
@@ -47,7 +66,6 @@ public class SFSession extends SFBaseSession {
// Need to be removed when a better way to organize session parameter is introduced.
private static final String CLIENT_STORE_TEMPORARY_CREDENTIAL =
"CLIENT_STORE_TEMPORARY_CREDENTIAL";
- private static final ObjectMapper mapper = ObjectMapperFactory.getObjectMapper();
private static final int MAX_SESSION_PARAMETERS = 1000;
// this constant was public - let's not change it
public static final int DEFAULT_HTTP_CLIENT_SOCKET_TIMEOUT =
@@ -931,7 +949,7 @@ protected void heartbeat() throws SFException, SQLException {
logger.debug("connection heartbeat response: {}", theResponse);
- rootNode = mapper.readTree(theResponse);
+ rootNode = OBJECT_MAPPER.readTree(theResponse);
// check the response to see if it is session expiration response
if (rootNode != null
diff --git a/src/main/java/net/snowflake/client/core/SFStatement.java b/src/main/java/net/snowflake/client/core/SFStatement.java
index 5715da73a..1dd555bb5 100644
--- a/src/main/java/net/snowflake/client/core/SFStatement.java
+++ b/src/main/java/net/snowflake/client/core/SFStatement.java
@@ -4,13 +4,15 @@
package net.snowflake.client.core;
-import static net.snowflake.client.core.SessionUtil.*;
+import static net.snowflake.client.core.SessionUtil.DEFAULT_CLIENT_MEMORY_LIMIT;
+import static net.snowflake.client.core.SessionUtil.DEFAULT_CLIENT_PREFETCH_THREADS;
+import static net.snowflake.client.core.SessionUtil.MAX_CLIENT_CHUNK_SIZE;
+import static net.snowflake.client.core.SessionUtil.MIN_CLIENT_CHUNK_SIZE;
import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;
import com.fasterxml.jackson.databind.JsonNode;
import java.sql.SQLException;
import java.sql.Statement;
-import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -23,7 +25,13 @@
import net.snowflake.client.core.BasicEvent.QueryState;
import net.snowflake.client.core.bind.BindException;
import net.snowflake.client.core.bind.BindUploader;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.QueryStatusV2;
+import net.snowflake.client.jdbc.SnowflakeDriver;
+import net.snowflake.client.jdbc.SnowflakeFileTransferAgent;
+import net.snowflake.client.jdbc.SnowflakeReauthenticationRequest;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
import net.snowflake.client.jdbc.telemetry.TelemetryData;
import net.snowflake.client.jdbc.telemetry.TelemetryField;
import net.snowflake.client.jdbc.telemetry.TelemetryUtil;
diff --git a/src/main/java/net/snowflake/client/core/SFTrustManager.java b/src/main/java/net/snowflake/client/core/SFTrustManager.java
index b73b7f934..0f66f3ef6 100644
--- a/src/main/java/net/snowflake/client/core/SFTrustManager.java
+++ b/src/main/java/net/snowflake/client/core/SFTrustManager.java
@@ -24,16 +24,38 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import java.security.*;
+import java.security.InvalidKeyException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.Provider;
+import java.security.Security;
+import java.security.Signature;
+import java.security.SignatureException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
-import javax.net.ssl.*;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509ExtendedTrustManager;
+import javax.net.ssl.X509TrustManager;
import net.snowflake.client.jdbc.OCSPErrorCode;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
@@ -61,14 +83,31 @@
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.ssl.SSLInitializationException;
-import org.bouncycastle.asn1.*;
+import org.bouncycastle.asn1.ASN1Encodable;
+import org.bouncycastle.asn1.ASN1Integer;
+import org.bouncycastle.asn1.ASN1ObjectIdentifier;
+import org.bouncycastle.asn1.ASN1OctetString;
+import org.bouncycastle.asn1.DEROctetString;
+import org.bouncycastle.asn1.DLSequence;
import org.bouncycastle.asn1.ocsp.CertID;
import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers;
-import org.bouncycastle.asn1.x509.*;
+import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.asn1.x509.Certificate;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.Extensions;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.TBSCertificate;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
-import org.bouncycastle.cert.ocsp.*;
+import org.bouncycastle.cert.ocsp.BasicOCSPResp;
+import org.bouncycastle.cert.ocsp.CertificateID;
+import org.bouncycastle.cert.ocsp.CertificateStatus;
+import org.bouncycastle.cert.ocsp.OCSPException;
+import org.bouncycastle.cert.ocsp.OCSPReq;
+import org.bouncycastle.cert.ocsp.OCSPReqBuilder;
+import org.bouncycastle.cert.ocsp.OCSPResp;
+import org.bouncycastle.cert.ocsp.RevokedStatus;
+import org.bouncycastle.cert.ocsp.SingleResp;
import org.bouncycastle.operator.DigestCalculator;
/**
diff --git a/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java b/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java
index 4fadcfe29..f43952023 100644
--- a/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java
+++ b/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java
@@ -5,7 +5,11 @@
package net.snowflake.client.core;
import com.google.common.base.Strings;
-import com.sun.jna.*;
+import com.sun.jna.Memory;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.WString;
import com.sun.jna.platform.win32.WinBase.FILETIME;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.win32.StdCallLibrary;
diff --git a/src/main/java/net/snowflake/client/core/SessionUtil.java b/src/main/java/net/snowflake/client/core/SessionUtil.java
index e17459f7f..305b5b220 100644
--- a/src/main/java/net/snowflake/client/core/SessionUtil.java
+++ b/src/main/java/net/snowflake/client/core/SessionUtil.java
@@ -17,10 +17,21 @@
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.PrivateKey;
-import java.util.*;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.SnowflakeDriver;
+import net.snowflake.client.jdbc.SnowflakeReauthenticationRequest;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
+import net.snowflake.client.jdbc.SnowflakeType;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.client.jdbc.telemetryOOB.TelemetryService;
import net.snowflake.client.log.ArgSupplier;
import net.snowflake.client.log.SFLogger;
diff --git a/src/main/java/net/snowflake/client/core/SessionUtilExternalBrowser.java b/src/main/java/net/snowflake/client/core/SessionUtilExternalBrowser.java
index 6e36f3adf..da7807b69 100644
--- a/src/main/java/net/snowflake/client/core/SessionUtilExternalBrowser.java
+++ b/src/main/java/net/snowflake/client/core/SessionUtilExternalBrowser.java
@@ -10,12 +10,23 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
-import java.net.*;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.TimeZone;
import net.snowflake.client.jdbc.ErrorCode;
import net.snowflake.client.jdbc.SnowflakeSQLException;
import net.snowflake.client.log.SFLogger;
diff --git a/src/main/java/net/snowflake/client/core/SessionUtilKeyPair.java b/src/main/java/net/snowflake/client/core/SessionUtilKeyPair.java
index 8c27d2c44..7830b55db 100644
--- a/src/main/java/net/snowflake/client/core/SessionUtilKeyPair.java
+++ b/src/main/java/net/snowflake/client/core/SessionUtilKeyPair.java
@@ -17,7 +17,14 @@
import java.io.StringReader;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.security.*;
+import java.security.InvalidKeyException;
+import java.security.KeyFactory;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Provider;
+import java.security.PublicKey;
+import java.security.Security;
import java.security.interfaces.RSAPrivateCrtKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
diff --git a/src/main/java/net/snowflake/client/core/SystemUtil.java b/src/main/java/net/snowflake/client/core/SystemUtil.java
new file mode 100644
index 000000000..1094261eb
--- /dev/null
+++ b/src/main/java/net/snowflake/client/core/SystemUtil.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
+ */
+
+package net.snowflake.client.core;
+
+import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;
+
+import net.snowflake.client.log.SFLogger;
+import net.snowflake.client.log.SFLoggerFactory;
+
+class SystemUtil {
+ private static final SFLogger logger = SFLoggerFactory.getLogger(SystemUtil.class);
+
+ /**
+ * Helper function to convert system properties to integers
+ *
+ * @param systemProperty name of the system property
+ * @param defaultValue default value used
+ * @return the value of the system property, else the default value
+ */
+ static int convertSystemPropertyToIntValue(String systemProperty, int defaultValue) {
+ String systemPropertyValue = systemGetProperty(systemProperty);
+ int returnVal = defaultValue;
+ if (systemPropertyValue != null) {
+ try {
+ returnVal = Integer.parseInt(systemPropertyValue);
+ } catch (NumberFormatException ex) {
+ logger.info(
+ "Failed to parse the system parameter {} with value {}",
+ systemProperty,
+ systemPropertyValue);
+ }
+ }
+ return returnVal;
+ }
+}
diff --git a/src/main/java/net/snowflake/client/core/arrow/BigIntToTimeConverter.java b/src/main/java/net/snowflake/client/core/arrow/BigIntToTimeConverter.java
index 9074a16bf..a902cb66a 100644
--- a/src/main/java/net/snowflake/client/core/arrow/BigIntToTimeConverter.java
+++ b/src/main/java/net/snowflake/client/core/arrow/BigIntToTimeConverter.java
@@ -6,12 +6,14 @@
import java.nio.ByteBuffer;
import java.sql.Time;
import java.sql.Timestamp;
-import java.time.*;
import java.util.TimeZone;
import net.snowflake.client.core.DataConversionContext;
import net.snowflake.client.core.ResultUtil;
import net.snowflake.client.core.SFException;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.SnowflakeTimestampWithTimezone;
+import net.snowflake.client.jdbc.SnowflakeType;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.common.core.SFTime;
import org.apache.arrow.vector.BigIntVector;
import org.apache.arrow.vector.ValueVector;
diff --git a/src/main/java/net/snowflake/client/core/arrow/IntToTimeConverter.java b/src/main/java/net/snowflake/client/core/arrow/IntToTimeConverter.java
index 15d3fbc8f..d704e31bd 100644
--- a/src/main/java/net/snowflake/client/core/arrow/IntToTimeConverter.java
+++ b/src/main/java/net/snowflake/client/core/arrow/IntToTimeConverter.java
@@ -10,7 +10,10 @@
import net.snowflake.client.core.DataConversionContext;
import net.snowflake.client.core.ResultUtil;
import net.snowflake.client.core.SFException;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.SnowflakeTimestampWithTimezone;
+import net.snowflake.client.jdbc.SnowflakeType;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.common.core.SFTime;
import org.apache.arrow.vector.IntVector;
import org.apache.arrow.vector.ValueVector;
diff --git a/src/main/java/net/snowflake/client/core/arrow/ThreeFieldStructToTimestampTZConverter.java b/src/main/java/net/snowflake/client/core/arrow/ThreeFieldStructToTimestampTZConverter.java
index cb7a18fa0..4c7f00d53 100644
--- a/src/main/java/net/snowflake/client/core/arrow/ThreeFieldStructToTimestampTZConverter.java
+++ b/src/main/java/net/snowflake/client/core/arrow/ThreeFieldStructToTimestampTZConverter.java
@@ -10,7 +10,11 @@
import net.snowflake.client.core.DataConversionContext;
import net.snowflake.client.core.ResultUtil;
import net.snowflake.client.core.SFException;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.SnowflakeDateWithTimezone;
+import net.snowflake.client.jdbc.SnowflakeTimeWithTimezone;
+import net.snowflake.client.jdbc.SnowflakeType;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.common.core.SFTimestamp;
import org.apache.arrow.vector.BigIntVector;
import org.apache.arrow.vector.IntVector;
diff --git a/src/main/java/net/snowflake/client/core/arrow/TwoFieldStructToTimestampLTZConverter.java b/src/main/java/net/snowflake/client/core/arrow/TwoFieldStructToTimestampLTZConverter.java
index abd2d49b9..339f3c541 100644
--- a/src/main/java/net/snowflake/client/core/arrow/TwoFieldStructToTimestampLTZConverter.java
+++ b/src/main/java/net/snowflake/client/core/arrow/TwoFieldStructToTimestampLTZConverter.java
@@ -10,7 +10,11 @@
import net.snowflake.client.core.DataConversionContext;
import net.snowflake.client.core.ResultUtil;
import net.snowflake.client.core.SFException;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.SnowflakeDateWithTimezone;
+import net.snowflake.client.jdbc.SnowflakeTimeWithTimezone;
+import net.snowflake.client.jdbc.SnowflakeType;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import org.apache.arrow.vector.BigIntVector;
import org.apache.arrow.vector.IntVector;
import org.apache.arrow.vector.ValueVector;
diff --git a/src/main/java/net/snowflake/client/core/bind/BindUploader.java b/src/main/java/net/snowflake/client/core/bind/BindUploader.java
index 1763672dd..2332f0150 100644
--- a/src/main/java/net/snowflake/client/core/bind/BindUploader.java
+++ b/src/main/java/net/snowflake/client/core/bind/BindUploader.java
@@ -19,7 +19,12 @@
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
import net.snowflake.client.core.ExecTimeTelemetryData;
import net.snowflake.client.core.ParameterBindingDTO;
import net.snowflake.client.core.SFBaseSession;
diff --git a/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java b/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
index 5d2661786..c4bf33241 100644
--- a/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
+++ b/src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
@@ -13,12 +13,47 @@
import net.snowflake.client.core.DataConversionContext;
import net.snowflake.client.core.SFBaseSession;
import net.snowflake.client.core.SFException;
-import net.snowflake.client.core.arrow.*;
+import net.snowflake.client.core.arrow.ArrowResultChunkIndexSorter;
+import net.snowflake.client.core.arrow.ArrowVectorConverter;
+import net.snowflake.client.core.arrow.BigIntToFixedConverter;
+import net.snowflake.client.core.arrow.BigIntToScaledFixedConverter;
+import net.snowflake.client.core.arrow.BigIntToTimeConverter;
+import net.snowflake.client.core.arrow.BigIntToTimestampLTZConverter;
+import net.snowflake.client.core.arrow.BigIntToTimestampNTZConverter;
+import net.snowflake.client.core.arrow.BitToBooleanConverter;
+import net.snowflake.client.core.arrow.DateConverter;
+import net.snowflake.client.core.arrow.DecimalToScaledFixedConverter;
+import net.snowflake.client.core.arrow.DoubleToRealConverter;
+import net.snowflake.client.core.arrow.IntToFixedConverter;
+import net.snowflake.client.core.arrow.IntToScaledFixedConverter;
+import net.snowflake.client.core.arrow.IntToTimeConverter;
+import net.snowflake.client.core.arrow.SmallIntToFixedConverter;
+import net.snowflake.client.core.arrow.SmallIntToScaledFixedConverter;
+import net.snowflake.client.core.arrow.ThreeFieldStructToTimestampTZConverter;
+import net.snowflake.client.core.arrow.TinyIntToFixedConverter;
+import net.snowflake.client.core.arrow.TinyIntToScaledFixedConverter;
+import net.snowflake.client.core.arrow.TwoFieldStructToTimestampLTZConverter;
+import net.snowflake.client.core.arrow.TwoFieldStructToTimestampNTZConverter;
+import net.snowflake.client.core.arrow.TwoFieldStructToTimestampTZConverter;
+import net.snowflake.client.core.arrow.VarBinaryToBinaryConverter;
+import net.snowflake.client.core.arrow.VarCharConverter;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.common.core.SqlState;
import org.apache.arrow.memory.RootAllocator;
-import org.apache.arrow.vector.*;
+import org.apache.arrow.vector.BigIntVector;
+import org.apache.arrow.vector.BitVector;
+import org.apache.arrow.vector.DateDayVector;
+import org.apache.arrow.vector.DecimalVector;
+import org.apache.arrow.vector.FieldVector;
+import org.apache.arrow.vector.Float8Vector;
+import org.apache.arrow.vector.IntVector;
+import org.apache.arrow.vector.SmallIntVector;
+import org.apache.arrow.vector.TinyIntVector;
+import org.apache.arrow.vector.ValueVector;
+import org.apache.arrow.vector.VarBinaryVector;
+import org.apache.arrow.vector.VarCharVector;
+import org.apache.arrow.vector.VectorSchemaRoot;
import org.apache.arrow.vector.complex.StructVector;
import org.apache.arrow.vector.ipc.ArrowStreamReader;
import org.apache.arrow.vector.types.Types;
diff --git a/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java b/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java
index 32c3b53ec..7ada3a803 100644
--- a/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java
+++ b/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java
@@ -8,15 +8,28 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.sql.*;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLNonTransientConnectionException;
+import java.sql.Statement;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Level;
import net.snowflake.client.config.SFClientConfig;
import net.snowflake.client.config.SFClientConfigParser;
-import net.snowflake.client.core.*;
+import net.snowflake.client.core.SFBaseResultSet;
+import net.snowflake.client.core.SFBaseSession;
+import net.snowflake.client.core.SFBaseStatement;
+import net.snowflake.client.core.SFException;
+import net.snowflake.client.core.SFSession;
+import net.snowflake.client.core.SFSessionProperty;
+import net.snowflake.client.core.SFStatement;
import net.snowflake.client.jdbc.telemetryOOB.TelemetryService;
-import net.snowflake.client.log.*;
+import net.snowflake.client.log.JDK14Logger;
+import net.snowflake.client.log.SFLogLevel;
+import net.snowflake.client.log.SFLogger;
+import net.snowflake.client.log.SFLoggerFactory;
+import net.snowflake.client.log.SFToJavaLogMapper;
import net.snowflake.common.core.LoginInfoDTO;
/**
diff --git a/src/main/java/net/snowflake/client/jdbc/RestRequest.java b/src/main/java/net/snowflake/client/jdbc/RestRequest.java
index 3e57d2ff1..615b20894 100644
--- a/src/main/java/net/snowflake/client/jdbc/RestRequest.java
+++ b/src/main/java/net/snowflake/client/jdbc/RestRequest.java
@@ -11,7 +11,13 @@
import javax.net.ssl.SSLKeyException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLProtocolException;
-import net.snowflake.client.core.*;
+import net.snowflake.client.core.Event;
+import net.snowflake.client.core.EventUtil;
+import net.snowflake.client.core.ExecTimeTelemetryData;
+import net.snowflake.client.core.HttpUtil;
+import net.snowflake.client.core.SFOCSPException;
+import net.snowflake.client.core.SessionUtil;
+import net.snowflake.client.core.UUIDUtils;
import net.snowflake.client.jdbc.telemetryOOB.TelemetryService;
import net.snowflake.client.log.ArgSupplier;
import net.snowflake.client.log.SFLogger;
diff --git a/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java b/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java
index 8e2798db7..bc164de89 100644
--- a/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java
+++ b/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java
@@ -8,7 +8,13 @@
import com.google.api.client.util.Strings;
import java.math.BigDecimal;
-import java.sql.*;
+import java.sql.Date;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
import java.util.List;
import java.util.TimeZone;
import net.snowflake.client.core.QueryStatus;
diff --git a/src/main/java/net/snowflake/client/jdbc/SFConnectionHandler.java b/src/main/java/net/snowflake/client/jdbc/SFConnectionHandler.java
index 0066e46cd..64297ff57 100644
--- a/src/main/java/net/snowflake/client/jdbc/SFConnectionHandler.java
+++ b/src/main/java/net/snowflake/client/jdbc/SFConnectionHandler.java
@@ -1,6 +1,9 @@
package net.snowflake.client.jdbc;
-import java.sql.*;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLNonTransientConnectionException;
+import java.sql.Statement;
import java.util.Properties;
import net.snowflake.client.core.SFBaseResultSet;
import net.snowflake.client.core.SFBaseSession;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java
index 521a00f07..0b5d7fe61 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeBaseResultSet.java
@@ -9,7 +9,21 @@
import java.io.StringReader;
import java.math.BigDecimal;
import java.net.URL;
-import java.sql.*;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.Date;
+import java.sql.NClob;
+import java.sql.Ref;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeBasicDataSource.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeBasicDataSource.java
index 0c7991d3f..f1281d593 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeBasicDataSource.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeBasicDataSource.java
@@ -1,7 +1,11 @@
package net.snowflake.client.jdbc;
import com.google.common.base.Strings;
-import java.io.*;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintWriter;
+import java.io.Serializable;
import java.security.PrivateKey;
import java.sql.Connection;
import java.sql.SQLException;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java
index a2bd4135e..ff9eb9003 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java
@@ -9,13 +9,37 @@
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.databind.MappingJsonFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.*;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.nio.ByteBuffer;
-import java.util.*;
-import java.util.concurrent.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Random;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
-import net.snowflake.client.core.*;
+import net.snowflake.client.core.ChunkDownloader;
+import net.snowflake.client.core.DownloaderMetrics;
+import net.snowflake.client.core.HttpClientSettingsKey;
+import net.snowflake.client.core.HttpUtil;
+import net.snowflake.client.core.OCSPMode;
+import net.snowflake.client.core.ObjectMapperFactory;
+import net.snowflake.client.core.QueryResultFormat;
+import net.snowflake.client.core.SFArrowResultSet;
+import net.snowflake.client.core.SFBaseSession;
+import net.snowflake.client.core.SessionUtil;
import net.snowflake.client.jdbc.SnowflakeResultChunk.DownloadState;
import net.snowflake.client.jdbc.telemetryOOB.TelemetryService;
import net.snowflake.client.log.ArgSupplier;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java
index d79a57ebd..9d7da8071 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java
@@ -10,7 +10,11 @@
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.net.URLEncoder;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
import net.snowflake.client.core.SFSessionProperty;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java
index 3f39bf285..0da7d44c8 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java
@@ -10,8 +10,32 @@
import com.google.common.base.Strings;
import java.io.IOException;
import java.io.InputStream;
-import java.sql.*;
-import java.util.*;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.ClientInfoStatus;
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverPropertyInfo;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaData.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaData.java
index ec1f7eb49..48b95e416 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaData.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaData.java
@@ -4,15 +4,38 @@
package net.snowflake.client.jdbc;
-import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.*;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_CATALOGS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_COLUMNS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_COLUMNS_EXTENDED_SET;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_FOREIGN_KEYS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_FUNCTIONS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_FUNCTION_COLUMNS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_PRIMARY_KEYS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_PROCEDURES;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_PROCEDURE_COLUMNS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_SCHEMAS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_STREAMS;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_TABLES;
+import static net.snowflake.client.jdbc.DBMetadataResultSetMetadata.GET_TABLE_PRIVILEGES;
import static net.snowflake.client.jdbc.SnowflakeType.convertStringToType;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Strings;
-import java.sql.*;
-import java.util.*;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.RowIdLifetime;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import java.util.regex.Pattern;
import net.snowflake.client.core.ObjectMapperFactory;
import net.snowflake.client.core.SFBaseSession;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaDataResultSet.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaDataResultSet.java
index bed368aba..456eed7d7 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaDataResultSet.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeDatabaseMetaDataResultSet.java
@@ -7,7 +7,13 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.StandardCharsets;
-import java.sql.*;
+import java.sql.Date;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
import java.util.List;
import java.util.TimeZone;
import net.snowflake.client.core.SFBaseSession;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java
index 7c610c715..9ef6077c4 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java
@@ -6,7 +6,12 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.util.List;
import java.util.Properties;
import net.snowflake.common.core.ResourceBundleManager;
@@ -23,7 +28,7 @@ public class SnowflakeDriver implements Driver {
static SnowflakeDriver INSTANCE;
public static final Properties EMPTY_PROPERTIES = new Properties();
- public static String implementVersion = "3.14.5";
+ public static String implementVersion = "3.14.6";
static int majorVersion = 0;
static int minorVersion = 0;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java
index cf4996715..9a0f874bb 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java
@@ -14,19 +14,54 @@
import com.google.common.base.Strings;
import com.google.common.io.ByteStreams;
import com.google.common.io.CountingOutputStream;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.SQLException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
import java.util.Map.Entry;
-import java.util.concurrent.*;
+import java.util.Optional;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPOutputStream;
-import net.snowflake.client.core.*;
-import net.snowflake.client.jdbc.cloud.storage.*;
+import net.snowflake.client.core.ExecTimeTelemetryData;
+import net.snowflake.client.core.HttpClientSettingsKey;
+import net.snowflake.client.core.OCSPMode;
+import net.snowflake.client.core.ObjectMapperFactory;
+import net.snowflake.client.core.SFBaseSession;
+import net.snowflake.client.core.SFException;
+import net.snowflake.client.core.SFFixedViewResultSet;
+import net.snowflake.client.core.SFSession;
+import net.snowflake.client.core.SFStatement;
+import net.snowflake.client.jdbc.cloud.storage.SnowflakeStorageClient;
+import net.snowflake.client.jdbc.cloud.storage.StageInfo;
+import net.snowflake.client.jdbc.cloud.storage.StorageClientFactory;
+import net.snowflake.client.jdbc.cloud.storage.StorageObjectMetadata;
+import net.snowflake.client.jdbc.cloud.storage.StorageObjectSummary;
+import net.snowflake.client.jdbc.cloud.storage.StorageObjectSummaryCollection;
+import net.snowflake.client.jdbc.cloud.storage.StorageProviderException;
import net.snowflake.client.jdbc.telemetryOOB.TelemetryService;
import net.snowflake.client.log.ArgSupplier;
import net.snowflake.client.log.SFLogger;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakePreparedStatementV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakePreparedStatementV1.java
index 5be0e53b1..b2dea22c0 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakePreparedStatementV1.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakePreparedStatementV1.java
@@ -9,10 +9,39 @@
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.URL;
-import java.sql.*;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
import java.sql.Date;
-import java.util.*;
-import net.snowflake.client.core.*;
+import java.sql.NClob;
+import java.sql.ParameterMetaData;
+import java.sql.PreparedStatement;
+import java.sql.Ref;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLXML;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TimeZone;
+import net.snowflake.client.core.ExecTimeTelemetryData;
+import net.snowflake.client.core.ParameterBindingDTO;
+import net.snowflake.client.core.ResultUtil;
+import net.snowflake.client.core.SFBaseResultSet;
+import net.snowflake.client.core.SFException;
+import net.snowflake.client.core.SFPreparedStatementMetaData;
+import net.snowflake.client.core.StmtUtil;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.client.util.VariableTypeArray;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java
index c99c38e8a..c0a9addea 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetSerializableV1.java
@@ -6,7 +6,12 @@
import static net.snowflake.client.core.Constants.GB;
import static net.snowflake.client.core.Constants.MB;
-import static net.snowflake.client.core.SessionUtil.*;
+import static net.snowflake.client.core.SessionUtil.CLIENT_ENABLE_CONSERVATIVE_MEMORY_USAGE;
+import static net.snowflake.client.core.SessionUtil.CLIENT_MEMORY_LIMIT;
+import static net.snowflake.client.core.SessionUtil.CLIENT_PREFETCH_THREADS;
+import static net.snowflake.client.core.SessionUtil.CLIENT_RESULT_CHUNK_SIZE;
+import static net.snowflake.client.core.SessionUtil.DEFAULT_CLIENT_MEMORY_LIMIT;
+import static net.snowflake.client.core.SessionUtil.DEFAULT_CLIENT_PREFETCH_THREADS;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -16,8 +21,31 @@
import java.nio.channels.ClosedByInterruptException;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.util.*;
-import net.snowflake.client.core.*;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Properties;
+import java.util.TimeZone;
+import net.snowflake.client.core.ChunkDownloader;
+import net.snowflake.client.core.HttpClientSettingsKey;
+import net.snowflake.client.core.MetaDataOfBinds;
+import net.snowflake.client.core.OCSPMode;
+import net.snowflake.client.core.ObjectMapperFactory;
+import net.snowflake.client.core.QueryResultFormat;
+import net.snowflake.client.core.ResultUtil;
+import net.snowflake.client.core.SFArrowResultSet;
+import net.snowflake.client.core.SFBaseResultSet;
+import net.snowflake.client.core.SFBaseSession;
+import net.snowflake.client.core.SFBaseStatement;
+import net.snowflake.client.core.SFResultSet;
+import net.snowflake.client.core.SFResultSetMetaData;
+import net.snowflake.client.core.SFSession;
+import net.snowflake.client.core.SFStatementType;
+import net.snowflake.client.core.SessionUtil;
import net.snowflake.client.jdbc.telemetry.NoOpTelemetryClient;
import net.snowflake.client.jdbc.telemetry.Telemetry;
import net.snowflake.client.log.ArgSupplier;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetV1.java
index e1068799b..30938b0e4 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetV1.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeResultSetV1.java
@@ -8,7 +8,22 @@
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
-import java.sql.*;
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.Date;
+import java.sql.NClob;
+import java.sql.Ref;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.RowId;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java
index b4f67bcf2..a4c9100c3 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java
@@ -6,10 +6,28 @@
import static net.snowflake.client.jdbc.ErrorCode.FEATURE_UNSUPPORTED;
-import java.sql.*;
-import java.util.*;
+import java.sql.BatchUpdateException;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.SQLWarning;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import net.snowflake.client.core.*;
+import net.snowflake.client.core.ExecTimeTelemetryData;
+import net.snowflake.client.core.ParameterBindingDTO;
+import net.snowflake.client.core.ResultUtil;
+import net.snowflake.client.core.SFBaseResultSet;
+import net.snowflake.client.core.SFBaseStatement;
+import net.snowflake.client.core.SFException;
+import net.snowflake.client.core.SFStatement;
+import net.snowflake.client.core.StmtUtil;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.client.util.VariableTypeArray;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeType.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeType.java
index 969373896..d7f30d614 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeType.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeType.java
@@ -5,7 +5,11 @@
package net.snowflake.client.jdbc;
import java.math.BigDecimal;
-import java.sql.*;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
import java.text.DateFormat;
import java.util.Date;
import java.util.HashSet;
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java
index 7a25e1b0d..2856e15e2 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java
@@ -8,14 +8,24 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Strings;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.lang.reflect.Field;
import java.sql.Time;
import java.sql.Types;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java
index 4622e7cb5..be54535ff 100644
--- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java
+++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java
@@ -10,18 +10,49 @@
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.microsoft.azure.storage.*;
-import com.microsoft.azure.storage.blob.*;
-import java.io.*;
+import com.microsoft.azure.storage.OperationContext;
+import com.microsoft.azure.storage.StorageCredentials;
+import com.microsoft.azure.storage.StorageCredentialsAnonymous;
+import com.microsoft.azure.storage.StorageCredentialsSharedAccessSignature;
+import com.microsoft.azure.storage.StorageException;
+import com.microsoft.azure.storage.StorageExtendedErrorInformation;
+import com.microsoft.azure.storage.blob.BlobListingDetails;
+import com.microsoft.azure.storage.blob.BlobProperties;
+import com.microsoft.azure.storage.blob.BlobRequestOptions;
+import com.microsoft.azure.storage.blob.CloudBlob;
+import com.microsoft.azure.storage.blob.CloudBlobClient;
+import com.microsoft.azure.storage.blob.CloudBlobContainer;
+import com.microsoft.azure.storage.blob.CloudBlockBlob;
+import com.microsoft.azure.storage.blob.ListBlobItem;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.SocketTimeoutException;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.InvalidKeyException;
-import java.util.*;
+import java.util.AbstractMap;
import java.util.AbstractMap.SimpleEntry;
+import java.util.ArrayList;
import java.util.Base64;
-import net.snowflake.client.core.*;
-import net.snowflake.client.jdbc.*;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import net.snowflake.client.core.HttpUtil;
+import net.snowflake.client.core.ObjectMapperFactory;
+import net.snowflake.client.core.SFBaseSession;
+import net.snowflake.client.core.SFSession;
+import net.snowflake.client.core.SFSessionProperty;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.FileBackedOutputStream;
+import net.snowflake.client.jdbc.MatDesc;
+import net.snowflake.client.jdbc.SnowflakeFileTransferAgent;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.client.util.SFPair;
diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java
index b1acfd2bc..98040b91b 100644
--- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java
+++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java
@@ -12,18 +12,45 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.api.gax.paging.Page;
import com.google.api.gax.rpc.FixedHeaderProvider;
-import com.google.cloud.storage.*;
+import com.google.cloud.storage.Blob;
+import com.google.cloud.storage.BlobId;
+import com.google.cloud.storage.BlobInfo;
+import com.google.cloud.storage.Storage;
import com.google.cloud.storage.Storage.BlobListOption;
+import com.google.cloud.storage.StorageException;
+import com.google.cloud.storage.StorageOptions;
import com.google.common.base.Strings;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.SocketTimeoutException;
import java.net.URISyntaxException;
import java.nio.channels.Channels;
import java.security.InvalidKeyException;
-import java.util.*;
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
-import net.snowflake.client.core.*;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.core.ExecTimeTelemetryData;
+import net.snowflake.client.core.HttpClientSettingsKey;
+import net.snowflake.client.core.HttpUtil;
+import net.snowflake.client.core.ObjectMapperFactory;
+import net.snowflake.client.core.SFSession;
+import net.snowflake.client.core.SFSessionProperty;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.FileBackedOutputStream;
+import net.snowflake.client.jdbc.MatDesc;
+import net.snowflake.client.jdbc.RestRequest;
+import net.snowflake.client.jdbc.SnowflakeFileTransferAgent;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.client.log.ArgSupplier;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java
index 2315bd74c..b5af0aef5 100644
--- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java
+++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java
@@ -22,12 +22,24 @@
import com.amazonaws.services.s3.AmazonS3Builder;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3EncryptionClient;
-import com.amazonaws.services.s3.model.*;
+import com.amazonaws.services.s3.model.AmazonS3Exception;
+import com.amazonaws.services.s3.model.CryptoConfiguration;
+import com.amazonaws.services.s3.model.CryptoMode;
+import com.amazonaws.services.s3.model.EncryptionMaterials;
+import com.amazonaws.services.s3.model.ObjectListing;
+import com.amazonaws.services.s3.model.ObjectMetadata;
+import com.amazonaws.services.s3.model.PutObjectRequest;
+import com.amazonaws.services.s3.model.S3Object;
+import com.amazonaws.services.s3.model.StaticEncryptionMaterialsProvider;
import com.amazonaws.services.s3.transfer.Download;
import com.amazonaws.services.s3.transfer.TransferManager;
import com.amazonaws.services.s3.transfer.TransferManagerBuilder;
import com.amazonaws.services.s3.transfer.Upload;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.SocketTimeoutException;
import java.security.InvalidKeyException;
import java.security.KeyManagementException;
@@ -40,8 +52,18 @@
import java.util.concurrent.ExecutorService;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
-import net.snowflake.client.core.*;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.core.HttpUtil;
+import net.snowflake.client.core.SFBaseSession;
+import net.snowflake.client.core.SFSSLConnectionSocketFactory;
+import net.snowflake.client.core.SFSession;
+import net.snowflake.client.core.SFSessionProperty;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.FileBackedOutputStream;
+import net.snowflake.client.jdbc.MatDesc;
+import net.snowflake.client.jdbc.SnowflakeFileTransferAgent;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
+import net.snowflake.client.jdbc.SnowflakeUtil;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.client.util.SFPair;
diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeStorageClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeStorageClient.java
index 1bd4127f6..2cd187dc3 100644
--- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeStorageClient.java
+++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeStorageClient.java
@@ -8,7 +8,11 @@
import java.util.Map;
import net.snowflake.client.core.HttpClientSettingsKey;
import net.snowflake.client.core.SFSession;
-import net.snowflake.client.jdbc.*;
+import net.snowflake.client.jdbc.ErrorCode;
+import net.snowflake.client.jdbc.FileBackedOutputStream;
+import net.snowflake.client.jdbc.MatDesc;
+import net.snowflake.client.jdbc.SnowflakeSQLException;
+import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
import net.snowflake.common.core.SqlState;
/**
diff --git a/src/main/java/net/snowflake/client/log/JDK14Logger.java b/src/main/java/net/snowflake/client/log/JDK14Logger.java
index 7c0a98dc6..d70009e16 100644
--- a/src/main/java/net/snowflake/client/log/JDK14Logger.java
+++ b/src/main/java/net/snowflake/client/log/JDK14Logger.java
@@ -10,7 +10,12 @@
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
-import java.util.logging.*;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.FileHandler;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.logging.SimpleFormatter;
import net.snowflake.client.core.EventHandler;
import net.snowflake.client.core.EventUtil;
import net.snowflake.client.util.SecretDetector;
diff --git a/src/main/java/net/snowflake/client/util/SecretDetector.java b/src/main/java/net/snowflake/client/util/SecretDetector.java
index a7bce22d3..0d43ec725 100644
--- a/src/main/java/net/snowflake/client/util/SecretDetector.java
+++ b/src/main/java/net/snowflake/client/util/SecretDetector.java
@@ -9,7 +9,11 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import java.io.IOException;
-import java.util.*;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.minidev.json.JSONArray;
@@ -47,10 +51,14 @@ public class SecretDetector {
+ "([a-z0-9!\"#$%&'\\()*+,-./:;<=>?@\\[\\]^_`\\{|\\}~]{6,})",
Pattern.CASE_INSENSITIVE);
- // "-----BEGIN PRIVATE KEY-----\n[PRIVATE-KEY]\n-----END PRIVATE KEY-----"
+ // "-----BEGIN PRIVATE KEY----- // #pragma: allowlist secret
+ // [PRIVATE-KEY]
+ // -----END PRIVATE KEY-----"
private static final Pattern PRIVATE_KEY_PATTERN =
Pattern.compile(
- "-----BEGIN PRIVATE KEY-----\\\\n([a-z0-9/+=\\\\n]{32,})\\\\n-----END PRIVATE KEY-----",
+ "-----BEGIN PRIVATE KEY-----" // #pragma: allowlist secret
+ + "\\\\n([a-z0-9/+=\\\\n]{32,})\\\\n"
+ + "-----END PRIVATE KEY-----",
Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);
// "privateKeyData": "[PRIVATE-KEY]"
@@ -233,7 +241,9 @@ public static String filterAccessTokens(String message) {
if (gcsMatcher.find()) {
message =
gcsMatcher.replaceAll(
- "-----BEGIN PRIVATE KEY-----\\\\nXXXX\\\\n-----END PRIVATE KEY-----");
+ "-----BEGIN PRIVATE KEY-----" // #pragma: allowlist secret
+ + "\\\\nXXXX\\\\n"
+ + "-----END PRIVATE KEY-----");
}
gcsMatcher = PRIVATE_KEY_DATA_PATTERN.matcher(message);
diff --git a/src/test/java/net/snowflake/client/AbstractDriverIT.java b/src/test/java/net/snowflake/client/AbstractDriverIT.java
index 7ec6243b2..7f762d48b 100644
--- a/src/test/java/net/snowflake/client/AbstractDriverIT.java
+++ b/src/test/java/net/snowflake/client/AbstractDriverIT.java
@@ -7,9 +7,18 @@
import com.google.common.base.Strings;
import java.net.URL;
-import java.sql.*;
+import java.sql.Connection;
import java.sql.Date;
-import java.util.*;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.TimeZone;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
diff --git a/src/test/java/net/snowflake/client/config/SFClientConfigParserTest.java b/src/test/java/net/snowflake/client/config/SFClientConfigParserTest.java
index 26a868ef7..a09c3036e 100644
--- a/src/test/java/net/snowflake/client/config/SFClientConfigParserTest.java
+++ b/src/test/java/net/snowflake/client/config/SFClientConfigParserTest.java
@@ -1,8 +1,15 @@
package net.snowflake.client.config;
-import static net.snowflake.client.config.SFClientConfigParser.*;
-import static net.snowflake.client.jdbc.SnowflakeUtil.*;
-import static org.junit.Assert.*;
+import static net.snowflake.client.config.SFClientConfigParser.SF_CLIENT_CONFIG_ENV_NAME;
+import static net.snowflake.client.config.SFClientConfigParser.SF_CLIENT_CONFIG_FILE_NAME;
+import static net.snowflake.client.config.SFClientConfigParser.getConfigFilePathFromJDBCJarLocation;
+import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;
+import static net.snowflake.client.jdbc.SnowflakeUtil.systemSetEnv;
+import static net.snowflake.client.jdbc.SnowflakeUtil.systemUnsetEnv;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.Mockito.mockStatic;
import java.io.IOException;
diff --git a/src/test/java/net/snowflake/client/core/CoreUtilsMiscellaneousTest.java b/src/test/java/net/snowflake/client/core/CoreUtilsMiscellaneousTest.java
index 054f67bfa..f11614c8b 100644
--- a/src/test/java/net/snowflake/client/core/CoreUtilsMiscellaneousTest.java
+++ b/src/test/java/net/snowflake/client/core/CoreUtilsMiscellaneousTest.java
@@ -4,7 +4,10 @@
package net.snowflake.client.core;
import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.Protocol;
diff --git a/src/test/java/net/snowflake/client/core/ObjectMapperTest.java b/src/test/java/net/snowflake/client/core/ObjectMapperTest.java
new file mode 100644
index 000000000..6868d186e
--- /dev/null
+++ b/src/test/java/net/snowflake/client/core/ObjectMapperTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
+ */
+
+package net.snowflake.client.core;
+
+import static org.junit.Assert.assertEquals;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.nio.charset.StandardCharsets;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Collection;
+import java.util.List;
+import net.snowflake.client.jdbc.SnowflakeUtil;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+public class ObjectMapperTest {
+ private static final int jacksonDefaultMaxStringLength = 20_000_000;
+
+ @Parameterized.Parameters(name = "lobSizeInMB={0}, maxJsonStringLength={1}")
+ public static Collection