Skip to content

Commit bcee3f8

Browse files
authored
[PECOBLR-399] Added connection params to DatabricksDriverPropertyUtil (#822)
* Added connection params to DatabricksDriverPropertyUtil * added connection params * params in driver property util Signed-off-by: Sai Shree Pradhan <[email protected]> * ssl related properties Signed-off-by: Sai Shree Pradhan <[email protected]> --------- Signed-off-by: Sai Shree Pradhan <[email protected]>
1 parent 30688be commit bcee3f8

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

src/main/java/com/databricks/jdbc/common/util/DatabricksDriverPropertyUtil.java

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ public class DatabricksDriverPropertyUtil {
3131
DatabricksJdbcUrlParams.DIRECT_RESULT,
3232
DatabricksJdbcUrlParams.COMPRESSION_FLAG,
3333
DatabricksJdbcUrlParams.LZ4_COMPRESSION_FLAG,
34-
DatabricksJdbcUrlParams.USER_AGENT_ENTRY);
34+
DatabricksJdbcUrlParams.USER_AGENT_ENTRY,
35+
DatabricksJdbcUrlParams.ENABLE_SQL_EXEC_HYBRID_RESULTS,
36+
DatabricksJdbcUrlParams.ENABLE_COMPLEX_DATATYPE_SUPPORT,
37+
DatabricksJdbcUrlParams.ROWS_FETCHED_PER_BLOCK,
38+
DatabricksJdbcUrlParams.DEFAULT_STRING_COLUMN_LENGTH,
39+
DatabricksJdbcUrlParams.SOCKET_TIMEOUT,
40+
DatabricksJdbcUrlParams.ENABLE_TOKEN_CACHE);
3541

3642
public static List<DriverPropertyInfo> getMissingProperties(String url, Properties info)
3743
throws DatabricksParsingException {
@@ -85,6 +91,31 @@ public static List<DriverPropertyInfo> buildMissingPropertiesList(
8591
addMissingProperty(missingPropertyInfos, connectionContext, LOG_FILE_COUNT, false);
8692
}
8793

94+
if (connectionContext.isPropertyPresent(SSL)) {
95+
addMissingProperty(missingPropertyInfos, connectionContext, SSL_TRUST_STORE, false);
96+
if (connectionContext.getSSLTrustStore() != null
97+
&& !connectionContext.getSSLTrustStore().isEmpty()) {
98+
addMissingProperty(missingPropertyInfos, connectionContext, SSL_TRUST_STORE_TYPE, false);
99+
}
100+
addMissingProperty(missingPropertyInfos, connectionContext, USE_SYSTEM_TRUST_STORE, false);
101+
addMissingProperty(missingPropertyInfos, connectionContext, ALLOW_SELF_SIGNED_CERTS, false);
102+
addMissingProperty(
103+
missingPropertyInfos, connectionContext, CHECK_CERTIFICATE_REVOCATION, false);
104+
if (connectionContext.checkCertificateRevocation()) {
105+
addMissingProperty(
106+
missingPropertyInfos,
107+
connectionContext,
108+
ACCEPT_UNDETERMINED_CERTIFICATE_REVOCATION,
109+
false);
110+
} else if (!connectionContext.isPropertyPresent(CHECK_CERTIFICATE_REVOCATION)) {
111+
addMissingProperty(
112+
missingPropertyInfos,
113+
connectionContext,
114+
ACCEPT_UNDETERMINED_CERTIFICATE_REVOCATION,
115+
false);
116+
}
117+
}
118+
88119
// auth-related properties
89120
AuthMech authMech = connectionContext.getAuthMech();
90121
if (authMech == PAT) {
@@ -113,6 +144,8 @@ public static List<DriverPropertyInfo> buildMissingPropertiesList(
113144
missingPropertyInfos, connectionContext, GOOGLE_SERVICE_ACCOUNT, true);
114145
addMissingProperty(
115146
missingPropertyInfos, connectionContext, GOOGLE_CREDENTIALS_FILE, true);
147+
} else if (connectionContext.getCloud() == Cloud.AZURE) {
148+
addMissingProperty(missingPropertyInfos, connectionContext, AZURE_TENANT_ID, false);
116149
}
117150
addMissingProperty(missingPropertyInfos, connectionContext, CLIENT_SECRET, true);
118151
addMissingProperty(missingPropertyInfos, connectionContext, CLIENT_ID, true);
@@ -134,6 +167,14 @@ public static List<DriverPropertyInfo> buildMissingPropertiesList(
134167
addMissingProperty(missingPropertyInfos, connectionContext, CLIENT_ID, false);
135168
addMissingProperty(missingPropertyInfos, connectionContext, CLIENT_SECRET, false);
136169
addMissingProperty(missingPropertyInfos, connectionContext, AUTH_SCOPE, false);
170+
addMissingProperty(
171+
missingPropertyInfos, connectionContext, OAUTH_REDIRECT_URL_PORT, false);
172+
addMissingProperty(missingPropertyInfos, connectionContext, ENABLE_TOKEN_CACHE, false);
173+
if (connectionContext.isPropertyPresent(ENABLE_TOKEN_CACHE)
174+
&& connectionContext.isTokenCacheEnabled()) {
175+
addMissingProperty(
176+
missingPropertyInfos, connectionContext, TOKEN_CACHE_PASS_PHRASE, true);
177+
}
137178
break;
138179

139180
case AZURE_MANAGED_IDENTITIES:

0 commit comments

Comments
 (0)