CREATE TABLE tableName(
colName colType,
...
colNameX colType
)WITH(
type ='oracle',
url ='jdbcUrl',
userName ='userName',
password ='pwd',
tableName ='tableName',
parallelism ='parllNum'
);
CREATE TABLE MyTable(
name varchar,
channel varchar,
id int
)WITH(
type ='kafka10',
bootstrapServers ='172.16.8.107:9092',
zookeeperQuorum ='172.16.8.107:2181/kafka',
offsetReset ='latest',
topic ='mqTest01',
timezone='Asia/Shanghai',
updateMode ='append',
enableKeyPartitions ='false',
topicIsPattern ='false',
parallelism ='1'
);
CREATE TABLE MyResult(
primarykey_id int ,
name VARCHAR,
address VARCHAR
)WITH(
type ='oracle',
url ='jdbc:oracle:thin:@172.16.8.178',
userName ='system',
password ='oracle',
tableName ='YELUO_TEST_ORACLE_01',
updateMode ='append',
parallelism ='1',
batchSize ='100',
batchWaitInterval ='1000'
);
insert
into
MyResult
select
id as primarykey_id,
channel as address,
name
from
MyTable a
{"name":"roc","id":11,"channel":"daishuyun"}
+---------+------+------+-----------+
| primarykey_id | name | address |
+---------+------+------+----------+
| 11 | roc | daishuyun |