Skip to content

Commit

Permalink
hbase 详细示例
Browse files Browse the repository at this point in the history
  • Loading branch information
dapeng committed May 21, 2020
1 parent 85285e2 commit c83dc91
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/plugin/hbaseSide.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ CREATE TABLE sideTable (
```
hbase(main):002:0> scan 'testFlinkStreamSql'
ROW COLUMN+CELL
0 column=wtz:info, timestamp=1587089266719, value=hadoop
0 column=wtz:message, timestamp=1587089245780, value=hbase
1 column=wtz:info, timestamp=1587088818432, value=flink
1 column=wtz:message, timestamp=1587088796633, value=dtstack
2 column=wtz:info, timestamp=1587088858564, value=sql
2 column=wtz:message, timestamp=1587088840507, value=stream
cfcd208495d565ef66e7dff9f98764dazhangsantest column=wtz:info, timestamp=1587089266719, value=hadoop
cfcd208495d565ef66e7dff9f98764dazhangsantest column=wtz:message, timestamp=1587089245780, value=hbase
c4ca4238a0b923820dcc509a6f75849blisitest column=wtz:info, timestamp=1587088818432, value=flink
c4ca4238a0b923820dcc509a6f75849blisitest column=wtz:message, timestamp=1587088796633, value=dtstack
c81e728d9d4c2f636f067f89cc14862cwangwutest column=wtz:info, timestamp=1587088858564, value=sql
c81e728d9d4c2f636f067f89cc14862cwangwutest column=wtz:message, timestamp=1587088840507, value=stream
```
在hbase中,rowKey是一个二进制码流,可以为任意字符串,flinkStreamSql读取rowKey并通过rowKey唯一确定数据,对rowKey没有任何限制,对rowKey可选择的构造包括 md5(alias + alias), '常量',也可以它们的自由组合。
在本次案例中,rowKey为了简单,设置成了"0,1,2"这样的数值型字符,若有必要,也可以设计得更为复杂。
Expand Down Expand Up @@ -138,7 +138,7 @@ CREATE TABLE MyResult(
CREATE TABLE sideTable (
wtz:message varchar as message,
wtz:info varchar as info ,
PRIMARY KEY (md5(key1) + key2),
PRIMARY KEY (md5(rowkey1) + rowkey2 + 'test'),
PERIOD FOR SYSTEM_TIME
) WITH (
type = 'hbase',
Expand Down Expand Up @@ -166,6 +166,6 @@ into
MyTable a
left join
sideTable b
on a.id=b.key1 and a.xx = b.key2;
on a.id=b.rowkey1 and a.name = b.rowkey2;
```

0 comments on commit c83dc91

Please sign in to comment.