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 {
213213 url = url . replace ( 'jdbc:spark://' , 'jdbc:databricks://' ) ;
214214 }
215215
216- const [ uid , pwd , cleanedUrl ] = extractAndRemoveUidPwdFromJdbcUrl ( url ) ;
216+ // eslint-disable-next-line prefer-const
217+ let [ uid , pwd , cleanedUrl ] = extractAndRemoveUidPwdFromJdbcUrl ( url ) ;
217218 const passwd = conf ?. token ||
218219 getEnv ( 'databricksToken' , { dataSource } ) ||
219220 pwd ;
@@ -236,6 +237,7 @@ export class DatabricksDriver extends JDBCDriver {
236237 // For magic numbers below - see Databricks docs:
237238 // https://docs.databricks.com/aws/en/integrations/jdbc-oss/configure#authenticate-the-driver
238239 if ( oauthClientId ) {
240+ cleanedUrl = cleanedUrl . replace ( / ; ? A u t h M e c h = [ ^ ; ] * / i, '' ) ;
239241 authProps = {
240242 OAuth2ClientID : oauthClientId ,
241243 OAuth2Secret : oauthClientSecret ,
@@ -244,9 +246,8 @@ export class DatabricksDriver extends JDBCDriver {
244246 } ;
245247 } else {
246248 authProps = {
247- user,
249+ UID : user ,
248250 PWD : passwd ,
249- AuthMech : 3 ,
250251 } ;
251252 }
252253
Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ export function extractAndRemoveUidPwdFromJdbcUrl(jdbcUrl: string): [uid: string
4848
4949 const cleanedUrl = jdbcUrl
5050 . 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, '' ) ;
5352
5453 return [ uid , pwd , cleanedUrl ] ;
5554}
You can’t perform that action at this time.
0 commit comments