2023-05-12 09:31:54 +08:00
|
|
|
INSERT INTO country_page_view
|
2023-05-19 14:28:25 +08:00
|
|
|
SELECT `user`,
|
2023-05-12 09:31:54 +08:00
|
|
|
cnt
|
|
|
|
FROM page_view_source;
|
|
|
|
|
|
|
|
INSERT INTO catalog1.db1.country_page_view
|
2023-05-19 14:28:25 +08:00
|
|
|
SELECT `user`,
|
2023-05-12 09:31:54 +08:00
|
|
|
cnt
|
|
|
|
FROM page_view_source;
|
|
|
|
|
|
|
|
|
|
|
|
--- Execute InsertStatement
|
|
|
|
EXECUTE
|
2023-05-19 14:28:25 +08:00
|
|
|
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30', country = 'China')
|
|
|
|
SELECT `user`,
|
2023-05-12 09:31:54 +08:00
|
|
|
cnt
|
|
|
|
FROM page_view_source;
|
|
|
|
|
|
|
|
--- Partition Clause: Static Partition
|
2023-05-19 14:28:25 +08:00
|
|
|
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30', country = 'China')
|
|
|
|
SELECT `user`,
|
2023-05-12 09:31:54 +08:00
|
|
|
cnt
|
|
|
|
FROM page_view_source;
|
|
|
|
|
|
|
|
--- Partition Clause: Dynamic Partition
|
2023-05-19 14:28:25 +08:00
|
|
|
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30')
|
|
|
|
SELECT `user`,
|
2023-05-12 09:31:54 +08:00
|
|
|
cnt,
|
|
|
|
country
|
|
|
|
FROM page_view_source;
|
|
|
|
|
|
|
|
--- Column List Statement
|
2023-05-19 14:28:25 +08:00
|
|
|
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30', country = 'China') (`date`, country)
|
|
|
|
SELECT `user`,
|
2023-05-12 09:31:54 +08:00
|
|
|
cnt
|
|
|
|
FROM page_view_source;
|
|
|
|
|
|
|
|
--- Insert Method: OverWrite
|
2023-05-19 14:28:25 +08:00
|
|
|
INSERT OVERWRITE country_page_view PARTITION (`date` = '2019-8-30')
|
|
|
|
SELECT `user`,
|
2023-05-12 09:31:54 +08:00
|
|
|
cnt,
|
|
|
|
country
|
|
|
|
FROM page_view_source;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|