INSERT OVERWRITE table_identifier [ partition_spec ] [ ( column_list ) ]{ VALUES ( { value | NULL } [ , ... ] ) [ , ( ... ) ] | query
table_identifier: Table name in the three-part format. Example: catalog.database.table.partition_spec: Partitioning column name and value Example: dt='2021-06-01'column_list: All the columnsquery: A general Select query statement.-- Insert Using a VALUES ClauseINSERT OVERWRITE students VALUES('Ashua Hill', '456 Erica Ct, Cupertino', 111111),('Brian Reed', '723 Kern Ave, Palo Alto', 222222);-- Insert Using a SELECT StatementINSERT OVERWRITE students PARTITION (student_id = 222222)SELECT name, address FROM persons WHERE name = "Dora Williams"-- Insert Using a TABLE StatementINSERT OVERWRITE students TABLE visiting_students-- Insert with a column listINSERT OVERWRITE students (address, name, student_id) VALUES('Hangzhou, China', 'Kent Yao', 11215016)-- Insert with both a partition spec and a column listINSERT OVERWRITE students PARTITION (student_id = 11215016) (address, name) VALUES('Hangzhou, China', 'Kent Yao Jr.')
Feedback