cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read sql file from a Repo to string

pabloaus
New Contributor III

I am trying to read a sql file in the repo to string. I have tried

with open("/Workspace/Repos/xx@***.com//file.sql","r") as queryFile:
   queryText = queryFile.read()

And I get following error.

[Errno 1] Operation not permitted: '/Workspace/Repos/***@***.com//file.sql'

1 ACCEPTED SOLUTION

Accepted Solutions

Senthil1
Contributor

Hi @pablous,

Make sure your REPOS is enabled by checking in Admin console and have full read/list privileges to do from workspace.

If all are perfect, then need to check whether there is anything blocks when we enable Unity Catalog, but i didn't feel anything related to this, since you r hitting GIT integrated repo acess, not the METASTORE repo access

View solution in original post

2 REPLIES 2

Senthil1
Contributor

Hi @pablous,

Make sure your REPOS is enabled by checking in Admin console and have full read/list privileges to do from workspace.

If all are perfect, then need to check whether there is anything blocks when we enable Unity Catalog, but i didn't feel anything related to this, since you r hitting GIT integrated repo acess, not the METASTORE repo access

Senthil1
Contributor

I checked in my unity_catalog enabled cluster, i am able to access the @repos file to read and display

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.