cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!