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