lava-oushudb-dt-sql-parser/test/parser/flinksql/syntax/fixtures/insertFromSelectQueries.sql
Hayden 40c911597b
refactor: improve keywords definations (#100)
* feat: improve keywords definations and add prefix named KW_

* test: capitalize keywords in alter sql test cases

* test: capitalize keywords in create sql test cases

* feat: merge interval rule and timeIntervalExpression rule in flinksql grammar

* test: put keywords in quotation marks around insert sql test cases

* test: put keywords in quotation marks around select sql test cases

* feat: improve uid rule

* test: rename sum to _sum because it is a reserved keyword

* docs: improve comments in flinkSqlLexer
2023-05-19 14:28:25 +08:00

48 lines
999 B
SQL

INSERT INTO country_page_view
SELECT `user`,
cnt
FROM page_view_source;
INSERT INTO catalog1.db1.country_page_view
SELECT `user`,
cnt
FROM page_view_source;
--- Execute InsertStatement
EXECUTE
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30', country = 'China')
SELECT `user`,
cnt
FROM page_view_source;
--- Partition Clause: Static Partition
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30', country = 'China')
SELECT `user`,
cnt
FROM page_view_source;
--- Partition Clause: Dynamic Partition
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30')
SELECT `user`,
cnt,
country
FROM page_view_source;
--- Column List Statement
INSERT INTO country_page_view PARTITION (`date` = '2019-8-30', country = 'China') (`date`, country)
SELECT `user`,
cnt
FROM page_view_source;
--- Insert Method: OverWrite
INSERT OVERWRITE country_page_view PARTITION (`date` = '2019-8-30')
SELECT `user`,
cnt,
country
FROM page_view_source;