Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run sql query on delta table

I have problem with delta lake docs. I know that I can query on delta table with presto,hive,spark sql and other tools but in delta's documents mentioned that "You can load a Delta table as a DataFrame by specifying a table name or a path"

from delta lake

but it isn't clear. how can I run sql query like that?

like image 696
Nestor Avatar asked Oct 20 '25 02:10

Nestor


1 Answers

Use the spark.sql() function

spark.sql("select * from delta.`hdfs://192.168.2.131:9000/Delta_Table/test001`").show()
like image 87
OneCricketeer Avatar answered Oct 22 '25 07:10

OneCricketeer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!