{"record":{"id":"cf6e9ee8fa982d12","repo":"apache/iceberg","slug":"failed-to-load-expected-jdbc-snowflakedriver-if","errorCode":null,"errorMessage":"Failed to load expected JDBC SnowflakeDriver - if queries fail by failing to find a suitable driver for jdbc:snowflake:// URIs, you must add the Snowflake  JDBC driver to your jars/packages","messagePattern":"Failed to load expected JDBC SnowflakeDriver - if queries fail by failing to find a suitable driver for jdbc:snowflake:// URIs, you must add the Snowflake  JDBC driver to your jars/packages","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java","lineNumber":116,"sourceCode":"\n  @Override\n  public void renameTable(TableIdentifier from, TableIdentifier to) {\n    throw new UnsupportedOperationException(\n        \"SnowflakeCatalog does not currently support renameTable\");\n  }\n\n  @Override\n  public void initialize(String name, Map<String, String> properties) {\n    String uri = properties.get(CatalogProperties.URI);\n    Preconditions.checkArgument(null != uri, \"JDBC connection URI is required\");\n    try {\n      // We'll ensure the expected JDBC driver implementation class is initialized through\n      // reflection regardless of which classloader ends up using this JdbcSnowflakeClient, but\n      // we'll only warn if the expected driver fails to load, since users may use repackaged or\n      // custom JDBC drivers for Snowflake communication.\n      Class.forName(JdbcSnowflakeClient.EXPECTED_JDBC_IMPL);\n    } catch (ClassNotFoundException cnfe) {\n      LOG.warn(\n          \"Failed to load expected JDBC SnowflakeDriver - if queries fail by failing\"\n              + \" to find a suitable driver for jdbc:snowflake:// URIs, you must add the Snowflake \"\n              + \" JDBC driver to your jars/packages\",\n          cnfe);\n    }\n\n    // The uniqueAppIdentifier should be less than 50 characters, so trimming the guid.\n    String uniqueId = UUID.randomUUID().toString().replace(\"-\", \"\").substring(0, UNIQUE_ID_LENGTH);\n    String uniqueAppIdentifier = APP_IDENTIFIER + \"_\" + uniqueId;\n    String userAgentSuffix = IcebergBuild.fullVersion() + \" \" + uniqueAppIdentifier;\n    // Populate application identifier in jdbc client\n    properties.put(JdbcCatalog.PROPERTY_PREFIX + JDBC_APPLICATION_PROPERTY, uniqueAppIdentifier);\n    // Adds application identifier to the user agent header of the JDBC requests.\n    properties.put(JdbcCatalog.PROPERTY_PREFIX + JDBC_USER_AGENT_SUFFIX_PROPERTY, userAgentSuffix);\n\n    JdbcClientPool connectionPool = new JdbcClientPool(uri, properties);\n\n    initialize(name, new JdbcSnowflakeClient(connectionPool), new FileIOFactory(), properties);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeCatalog.java#L98-L134","documentation":"SnowflakeCatalog.initialize loads the Snowflake JDBC driver class via reflection and only warns on ClassNotFoundException, because users may supply repackaged or custom drivers. If no suitable driver is on the classpath, later queries over jdbc:snowflake:// URIs will fail at connection time.","triggerScenarios":"Initializing SnowflakeCatalog (initialize with catalog options) in an environment where the Snowflake JDBC driver (net.snowflake.client.jdbc.SnowflakeDriver) is not on the classpath.","commonSituations":"Missing Snowflake JDBC jar in Spark/Flink submit packages; shaded/deployment jars excluding the driver; running on engines where the driver is not bundled by default.","solutions":["Add the Snowflake JDBC driver jar to your deployment (e.g. --packages net.snowflake:snowflake-jdbc:<version>)","Verify the driver class net.snowflake.client.jdbc.SnowflakeDriver is loadable from the catalog's classloader","If using a custom/repackaged JDBC driver, confirm it registers itself for jdbc:snowflake:// URIs and treat the warning as informational"],"exampleFix":"// before\nspark-submit --jars iceberg-snowflake-runtime.jar ...\n// after\nspark-submit --packages net.snowflake:snowflake-jdbc:3.14.4 --jars iceberg-snowflake-runtime.jar ...","handlingStrategy":"validation","validationCode":"try { Class.forName(\"net.snowflake.client.jdbc.SnowflakeDriver\"); } catch (ClassNotFoundException e) { throw new IllegalStateException(\"Add net.snowflake:snowflake-jdbc to the classpath\"); }","typeGuard":null,"tryCatchPattern":"try { catalog.initialize(name, options); } catch (RuntimeException e) { /* check logs for SnowflakeDriver load warning; ensure driver jar present before proceeding */ }","preventionTips":["Include snowflake-jdbc in every deployment that uses SnowflakeCatalog","Test catalog init in CI with the same classpath as production","When shading, keep the JDBC driver as a separate provided jar"],"tags":["snowflake","jdbc","classpath","driver"],"backgroundTag":"class-not-found","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}