INSERT OVERWRITE table_identifier [ partition_spec ] [ ( column_list ) ]{ VALUES ( { value | NULL } [ , ... ] ) [ , ( ... ) ] | query
table_identifier:指定表名,支持三段式,例如:catalog.database.tablepartition_spec:分区列和值。例如 dt='2021-06-01'。column_list:列的所有。query:一个通用 Select 查询语句。-- 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.')
文档反馈