建表备份
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
CREATE TABLE etl.company (
|
||||||
|
district String,
|
||||||
|
ent_name String,
|
||||||
|
reg_addr String,
|
||||||
|
unified_code String,
|
||||||
|
authority String
|
||||||
|
) ENGINE MySQL('192.168.0.20:3306', 'database', 'td_gov_company_basic', 'root', '12345678')
|
||||||
|
SETTINGS
|
||||||
|
connection_wait_timeout=9999999,
|
||||||
|
connect_timeout=9999999,
|
||||||
|
read_write_timeout=9999999,
|
||||||
|
connection_auto_close=false;
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
CREATE TABLE etl.dwm_company (
|
||||||
|
district String,
|
||||||
|
ent_name String,
|
||||||
|
reg_addr String,
|
||||||
|
unified_code String,
|
||||||
|
authority String,
|
||||||
|
m_date DateTime('Asia/Shanghai') default now() COMMENT '更新时间'
|
||||||
|
) ENGINE ReplacingMergeTree(m_date)
|
||||||
|
PARTITION BY district PRIMARY KEY (unified_code) ORDER BY (unified_code);
|
||||||
|
|
||||||
|
INSERT INTO etl.dwm_company(
|
||||||
|
district String,
|
||||||
|
ent_name String,
|
||||||
|
reg_addr String,
|
||||||
|
unified_code String,
|
||||||
|
authority String) SELECT * FROM etl.company
|
||||||
Reference in New Issue
Block a user