This statement is used to create views.
1 | CREATE [OR REPLACE] VIEW view_name AS select_statement; |
For example, if a table is created using Spark 3.x, you are advised to use Spark 2.x to create a view.
To create a view named student_view for the queried ID and name of the student table, run the following statement:
1 | CREATE VIEW student_view AS SELECT id, name FROM student; |