cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

how to read delta table from the path?

andrew0117
Contributor

an unmanaged delta table is dropped and the real data still there. Now I'm trying to rebuild it, but don't know the schema. So, I tried: val myTable = DeltaTable.forPath("myPath"). But how can I get the data or schema out from myTable?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Hubert-Dudek
Esteemed Contributor III

or

SELECT * FROM `delta`./mypathtodeltafolder/;

View solution in original post

2 REPLIES 2

daniel_sahal
Esteemed Contributor

@andrew li​ 

df = spark.read.format("delta").load("/file_path")
df.printSchema()

Hubert-Dudek
Esteemed Contributor III

or

SELECT * FROM `delta`./mypathtodeltafolder/;

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.