CREATE TABLE tableName(
colName colType,
...
colNameX colType
)WITH(
type ='kudu',
kuduMasters ='ip1,ip2,ip3',
tableName ='impala::default.test',
writeMode='upsert',
workerCount='1',
defaultOperationTimeoutMs='600000',
defaultSocketReadTimeoutMs='6000000',
parallelism ='parllNum'
);
CREATE TABLE MyTable(
channel varchar,
name varchar,
pv varchar,
a varchar,
b varchar
)WITH(
type ='kafka11',
bootstrapServers ='172.16.8.107:9092',
zookeeperQuorum ='172.16.8.107:2181/kafka',
offsetReset ='latest',
topic ='es_test',
timezone='Asia/Shanghai',
updateMode ='append',
enableKeyPartitions ='false',
topicIsPattern ='false',
parallelism ='1'
);
CREATE TABLE MyResult(
a string,
b string,
c string,
d string
)WITH(
type ='kudu',
kuduMasters ='cdh03.cdhsite:7051',
tableName ='myresult',
writeMode='insert',
parallelism ='1'
);
CREATE TABLE sideTable(
c string,
d string,
PRIMARY KEY(c) ,
PERIOD FOR SYSTEM_TIME
)WITH(
type ='kudu',
kuduMasters ='cdh03.cdhsite:7051',
tableName ='sidetest4',
partitionedJoin ='false',
cache ='LRU',
cacheSize ='10000',
cacheTTLMs ='60000',
parallelism ='1',
primaryKey ='c',
isFaultTolerant ='false'
);
insert
into
MyResult
select
MyTable.a,
MyTable.b,
s.c,
s.d
from
MyTable
join
sideTable s
on MyTable.a = s.c
where
MyTable.a='2'
and s.d='2'
{"channel":"daishuyun","name":"roc","pv":"10","a":"2","b":"2"}
{"a":"2","b":"2","c":"3","d":"4"}
create table dwd (
name varchar,
id int
) WITH (
type='kudu',
kuduMasters='host1',
tableName='foo',
writeMode='insert',
parallelism ='1',
keytab='foo/foobar.keytab',
krb5conf='bar/krb5.conf',
principal='kudu/[email protected]'
);