Driver capability settings for the Databricks JDBC Driver
This article applies to the Databricks JDBC Simba driver. For the Databricks-developed JDBC driver, see Databricks JDBC Driver (OSS).
This article describes how to configure special and advanced driver capability settings for the Databricks JDBC Driver.
The Databricks JDBC Driver provides the following special and advanced driver capability settings.
- ANSI SQL-92 query support in JDBC
- Default catalog and schema
- Query tags for tracking
- Extract large query results in JDBC
- Arrow serialization in JDBC
- Enable logging
ANSI SQL-92 query support in JDBC
Legacy Spark JDBC drivers accept SQL queries in ANSI SQL-92 dialect and translate the queries to the Databricks SQL dialect before sending them to the server. However, if your application generates Databricks SQL directly or your application uses any non-ANSI SQL-92 standard SQL syntax specific to Databricks, Databricks recommends that you set UseNativeQuery=1
as a connection configuration. With that setting, the driver passes the SQL queries verbatim to Databricks.
Default catalog and schema
To specify the default catalog and schema, add ConnCatalog=<catalog-name>;ConnSchema=<schema-name>
to the JDBC connection URL.
Query tags for tracking
This feature is in Private Preview. To request access, contact your account team.
You can attach key-value tags to your SQL queries for tracking and analytics purposes. Query tags appear in the system.query.history
table for query identification and analysis.
To add query tags to your connection, include the ssp_query_tags
parameter in your JDBC connection URL:
jdbc:databricks://<server-hostname>:443;httpPath=<http-path>;ssp_query_tags=key1:value1,key2:value2
Define query tags as comma-separated key-value pairs where each key and value is separated by a colon, for example, key1:value1,key2:value2
.
Extract large query results in JDBC
To achieve the best performance when you extract large query results, use the latest version of the JDBC driver, which includes the following optimizations.
Arrow serialization in JDBC
JDBC driver version 2.6.16 and above supports an optimized query results serialization format that uses Apache Arrow.
Enable logging
To enable logging in the JDBC driver, set the LogLevel
property from 1
to log only severe events through 6
to log all driver activity. Set the LogPath
property to the full path to the folder where you want to save log files.
For more information, see the Configuring Logging
section in the Databricks JDBC Driver Guide.