0

I have a Databricks python notebook reading ADL configurations from a JSON file on DBFS. I am able to read the file fine and the DF generated shows the values with the below schema.

testJsonData:pyspark.sql.dataframe.DataFrame

clientId:string
oauth2Credential:string
oauth2RefreshUrl:string
providerType:string

I am having challenges in reading a specific row value. I am getting a row object but doesn't give me the value of the row.

testJsonData.select('clientId').collect()
Out[65]: [Row(clientId='6xxxx08vvvvvvvvv7f')]

Appreciate any pointers helping with this.

1

1 Answer 1

0

Hope this helps someone having a similar issue, I read the config values like this

   configlist = testJsonData.select("*").collect()
   dataProviderType = configlist[0].providerType
   dataClientId = configlist[0].clientId
   dataOAuthCredential = configlist[0].oauth2Credential
   dataOAuthUrl = configlist[0].outh2RefreshUrl
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.