glueContext.extract_jdbc_conf() behaves inconsistently between Notebook and Script execution

0

Sample code (minus boilerplate):

conn = glueContext.extract_jdbc_conf(connection_name="My-Glue-Connection")

for i in conn.items:
    print(i)

Output from notebook:

('enforceSSL', 'false')
('skipCustomJDBCCertValidation', 'false')
('url', 'jdbc:sqlserver://0.0.0.0:1433')
('customJDBCCertString', '')
('user', 'test')
('customJDBCCert', '')
('password', 'xxx')
('vendor', 'sqlserver')

Output from running job:

**('fullUrl', 'jdbc:sqlserver://0.0.0.0:1433/mydb')**
('enforceSSL', 'false')
('skipCustomJDBCCertValidation', 'false')
('url', 'jdbc:sqlserver://0.0.0.0:1433')
('customJDBCCertString', '')
('user', 'test')
('customJDBCCert', '')
('password', 'xxx')
('vendor', 'sqlserver')

fullUrl (and thus the name of the database to connect to) is not available when using this method in a notebook.

asked a year ago223 views
2 Answers
0

Hello,

I understand that glueContext.extract_jdbc_conf() is behaving inconsistently between Notebook and Script execution.

From the document https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-crawler-pyspark-extensions-glue-context.html#aws-glue-api-crawler-pyspark-extensions-glue-context-extract_jdbc_conf I could see that extract_jdbc_conf() should return the fullUrl for JDBC.

Therefore, I also tested at my end and found that when executing the Glue Job script the extract_jdbc_conf() is returning the 'fullUrl' details but when I tested this in Notebook interactive session it did not return the 'fullUrl' details.

Hence this was leading to inconsistent behaviour and by not getting the fullUrl you could not get the database which needs to be connected.

Thank you for bringing this to our noticed. I have informed this issue to our internal team, but please note that I do not have a ETA on the fix for the same as we do not have visibility on the internal team's roadmap. If I hear any update on this from the internal team will update you on the same.

Having said that I would also like to apologize for any inconvenience this issue must have caused you.

AWS
SUPPORT ENGINEER
answered a year ago
0

Hello,

I would like to update you that the issue has been resolved and extract_jdbc_conf() is returning the 'fullUrl' details in Notebook interactive session for Glue 3.0 as well.

AWS
SUPPORT ENGINEER
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions