File tree Expand file tree Collapse file tree 1 file changed +59
-14
lines changed
Expand file tree Collapse file tree 1 file changed +59
-14
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ CREATE TABLE tableName(
1313 tableName ='tableName',
1414 parallelism ='parllNum'
1515 );
16-
17-
1816```
1917
2018## 2.支持版本
@@ -50,17 +48,64 @@ redis5.0
5048
5149## 5.样例:
5250```
51+ CREATE TABLE MyTable(
52+ name varchar,
53+ channel varchar
54+ )WITH(
55+ type ='kafka10',
56+ bootstrapServers ='172.16.8.107:9092',
57+ zookeeperQuorum ='172.16.8.107:2181/kafka',
58+ offsetReset ='latest',
59+ topic ='mqTest01',
60+ timezone='Asia/Shanghai',
61+ updateMode ='append',
62+ enableKeyPartitions ='false',
63+ topicIsPattern ='false',
64+ parallelism ='1'
65+ );
66+
5367 CREATE TABLE MyResult(
54- channel varchar,
55- pv varchar,
56- PRIMARY KEY(channel)
57- )WITH(
58- type='redis',
59- url='172.16.10.79:6379',
60- password='abc123',
61- database='0',
62- redisType='1',
63- tableName='sinktoredis'
64- );
68+ channel VARCHAR,
69+ pv VARCHAR
70+ )WITH(
71+ type ='redis',
72+ redisType ='1',
73+ url ='172.16.8.109:6379',
74+ tableName ='resultTable',
75+ partitionedJoin ='false',
76+ parallelism ='1',
77+ database ='0',
78+ timeout ='10000',
79+ maxTotal ='60000',
80+ maxIdle='8',
81+ minIdle='0'
82+ );
83+
84+ insert
85+ into
86+ MyResult
87+ select
88+ channel,
89+ name as pv
90+ from
91+ MyTable a
92+ ```
93+
94+ ## 6.redis完整样例
95+ ### redis数据说明
96+ redis使用k-v格式存储,key的构建格式为tableName:privateKey:privateKeyValue: columnName , value=columnValue
6597
66- ```
98+ ### 源表数据内容
99+ ```
100+ {"name":"roc","channel":"daishu","age":2}
101+ ```
102+ ### redis实际数据内容
103+ ```
104+ 127.0.0.1:6379> keys *
105+ 1) "resultTable:name:roc:name"
106+ 2) "resultTable:name:roc:channel"
107+ 127.0.0.1:6379> get "resultTable:name:roc:name"
108+ "roc"
109+ 127.0.0.1:6379> get "resultTable:name:roc:channel"
110+ "daishu"
111+ ```
You can’t perform that action at this time.
0 commit comments