File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
packages/cubejs-databricks-jdbc-driver/src Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,8 @@ export class DatabricksDriver extends JDBCDriver {
213
213
url = url . replace ( 'jdbc:spark://' , 'jdbc:databricks://' ) ;
214
214
}
215
215
216
- const [ uid , pwd , cleanedUrl ] = extractAndRemoveUidPwdFromJdbcUrl ( url ) ;
216
+ // eslint-disable-next-line prefer-const
217
+ let [ uid , pwd , cleanedUrl ] = extractAndRemoveUidPwdFromJdbcUrl ( url ) ;
217
218
const passwd = conf ?. token ||
218
219
getEnv ( 'databricksToken' , { dataSource } ) ||
219
220
pwd ;
@@ -236,6 +237,7 @@ export class DatabricksDriver extends JDBCDriver {
236
237
// For magic numbers below - see Databricks docs:
237
238
// https://docs.databricks.com/aws/en/integrations/jdbc-oss/configure#authenticate-the-driver
238
239
if ( oauthClientId ) {
240
+ cleanedUrl = cleanedUrl . replace ( / ; ? A u t h M e c h = [ ^ ; ] * / i, '' ) ;
239
241
authProps = {
240
242
OAuth2ClientID : oauthClientId ,
241
243
OAuth2Secret : oauthClientSecret ,
@@ -244,9 +246,8 @@ export class DatabricksDriver extends JDBCDriver {
244
246
} ;
245
247
} else {
246
248
authProps = {
247
- user,
249
+ UID : user ,
248
250
PWD : passwd ,
249
- AuthMech : 3 ,
250
251
} ;
251
252
}
252
253
Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ export function extractAndRemoveUidPwdFromJdbcUrl(jdbcUrl: string): [uid: string
48
48
49
49
const cleanedUrl = jdbcUrl
50
50
. replace ( / ; ? U I D = [ ^ ; ] * / i, '' )
51
- . replace ( / ; ? P W D = [ ^ ; ] * / i, '' )
52
- . replace ( / ; ? A u t h M e c h = [ ^ ; ] * / i, '' ) ;
51
+ . replace ( / ; ? P W D = [ ^ ; ] * / i, '' ) ;
53
52
54
53
return [ uid , pwd , cleanedUrl ] ;
55
54
}
You can’t perform that action at this time.
0 commit comments