cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

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

rpl
Contributor

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
Contributor

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
Contributor

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

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now