cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform 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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group