Creating tables from dataframes
Continuing from our last post: Reading file into dataframe
- Let's create a table from the dataframe:
- Dataframe.write.saveAsTable("Database.tablename")
- We need to remember that we are creating a managed table with the above syntax, and to create an unmanaged table we can add the path option.
- Now we can Query the tables using SQL.
- Reference for the difference between managed and unmanaged tables: Click here
Comments
Post a Comment