lava-oushudb-dt-sql-parser/test/parser/flink/syntax/fixtures/insertFromSelectQueries.sql
Hayden bb0fad1dbe
refactor: standard naming (#278)
* refactor: rename flinksql to flink

* refactor: rename pgsql to postgresql

* refactor: rename trinosql to trino

* refactor: replace all default exports with named export

* refactor: rename basicParser to basicSQL

* refactor: rename basic-parser-types to types

* refactor: replace arrow func with plain func
2024-03-27 10:33:25 +08:00

55 lines
1.1 KiB
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;
--- Insert with function
INSERT INTO hbase_table
SELECT
st.id as rowKey,
ROW(id, name, age) as baseInfo
FROM sourceTable st;