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.

已提問 1 年前檢視次數 229 次
2 個答案
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
支援工程師
已回答 1 年前
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
支援工程師
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南