cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Read file with Delta Live Tables from external location (Unity Catalog)

rpl
New Contributor III

As far as I understand, Delta Live Tables should now support reading data from an external location, but I canโ€™t get it to work. Iโ€™ve added an ADLS container to Unity Catalog as an external location. Thereโ€™s a folder in the container containing an example file with one json object per line.

Reading the file with an all-purpose cluster or a job cluster works with this code.

 

df = spark.read.format("json").load("abfss://<container_name>@<storage_name>.dfs.core.windows.net/test_json/")
df.printSchema

 

As far as I understand, this is the counterpart that should work in a DLT pipeline.

 

import dlt
@dlt.table
def test_data():
  return (
     spark.readStream.format("cloudFiles")
     .option("cloudFiles.format", "json")
     .load(f"abfss://<container_name>@<storage_name>.dfs.core.windows.net/test_json/")
 )

 

But I get the error Failed to resolve flow: 'test_data'. What am I doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions

rpl
New Contributor III

I misspelled the folder name; I got it working now ๐Ÿ˜€ The error message could have been more informative

View solution in original post

1 REPLY 1

rpl
New Contributor III

I misspelled the folder name; I got it working now ๐Ÿ˜€ The error message could have been more informative

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!