01-27-2023 06:04 AM
Hi!
I saved a dataframe as a delta table with the following syntax:
(test_df
.write
.format("delta")
.mode("overwrite")
.save(output_path)
)
How can I issue a SELECT statement on the table?
What do I need to insert into [table_name] below?
SELECT * FROM [table_name]
01-27-2023 08:20 AM
Hi @John B there is two way to access your delta table-
SELECT * FROM delta.`your_delta_table_path`
df.write.format("delta").mode("overwrite").option("path", "your_path").saveAsTable("table_name")
Now you can use your select query-
SELECT * FROM [table_name]
01-27-2023 08:49 AM
Hi @Ajay Pandey
When trying the first option I get:
01-27-2023 08:49 PM
Hi @John B in the above code instead of your path variable put your absolute path. Please refer to snapshot-
01-27-2023 08:59 PM
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