File tree Expand file tree Collapse file tree 1 file changed +42
-10
lines changed
Expand file tree Collapse file tree 1 file changed +42
-10
lines changed Original file line number Diff line number Diff line change @@ -41,19 +41,51 @@ hbase2.0
4141
4242## 5.样例:
4343```
44- CREATE TABLE MyResult (
45- cf:info VARCHAR ,
46- cf:name VARCHAR ,
47- cf:channel varchar
44+ CREATE TABLE MyTable (
45+ name varchar ,
46+ channel varchar ,
47+ age int
4848 )WITH(
49- type ='hbase',
50- zookeeperQuorum ='xx:2181',
51- zookeeperParent ='/hbase',
52- tableName ='workerinfo01',
53- rowKey ='channel'
49+ type ='kafka10',
50+ bootstrapServers ='172.16.8.107:9092',
51+ zookeeperQuorum ='172.16.8.107:2181/kafka',
52+ offsetReset ='latest',
53+ topic ='mqTest01',
54+ timezone='Asia/Shanghai',
55+ updateMode ='append',
56+ enableKeyPartitions ='false',
57+ topicIsPattern ='false',
58+ parallelism ='1'
59+ );
60+
61+ CREATE TABLE MyResult(
62+ cf:name varchar ,
63+ cf:channel varchar
64+ )WITH(
65+ type ='hbase',
66+ zookeeperQuorum ='172.16.10.104:2181,172.16.10.224:2181,172.16.10.252:2181',
67+ zookeeperParent ='/hbase',
68+ tableName ='myresult',
69+ partitionedJoin ='false',
70+ parallelism ='1',
71+ rowKey='name,channel'
5472 );
73+
74+ insert
75+ into
76+ MyResult
77+ select
78+ channel,
79+ name
80+ from
81+ MyTable a
5582 ```
5683
5784## 6.hbase数据
5885### 数据内容说明
59- ### 数据内容示例
86+ hbase的rowkey 构建规则:以描述的rowkey字段值作为key,多个字段以'-'连接
87+ ### 数据内容示例
88+ hbase(main):007:0> scan 'myresult'
89+ ROW COLUMN+CELL
90+ roc-daishu column=cf: channel , timestamp=1589183971724, value=daishu
91+ roc-daishu column=cf: name , timestamp=1589183971724, value=roc
You can’t perform that action at this time.
0 commit comments