Hi,我遇到一个问题,我在hive catalog里定义一个hbase connector表,如下:
CREATE TABLE t_sems_second ( rowkey string, status row (val VARCHAR, dqf VARCHAR), analog row (val VARCHAR, dqf VARCHAR) ) WITH ( 'connector' = 'hbase-1.4', 'table-name' = 't_sems_second', 'zookeeper.quorum' = 'dev-hadoop-node-c:2181,dev-hadoop-node-d:2181,dev-hadoop-node-e:2181' ); 然后,我在flink-sql,运行sql插入数据,没有问题,如下: insert into t_sems_second (rowkey, analog, status) values( 'row2', row('a', '100'), row('b', '200') ); 如果我尝试把第二个列簇的内容置为空字符串,也是可以,如下: insert into t_sems_second (rowkey, analog, status) values( 'row3', row('c', '300'), row('', '') ); 但是在hbase查询里,就会显示如下的空字符串: hbase(main):019:0> scan 't_sems_second' ROW COLUMN+CELL row2 column=analog:dqf, timestamp=1599639282193, value=200 row2 column=analog:val, timestamp=1599639282193, value=b row2 column=status:dqf, timestamp=1599639282193, value=100 row2 column=status:val, timestamp=1599639282193, value=a * row3 column=analog:dqf, timestamp=1599639292413, value= row3 column=analog:val, timestamp=1599639292413, value= * row3 column=status:dqf, timestamp=1599639292413, value=300 row3 column=status:val, timestamp=1599639292413, value=c 2 row(s) Took 0.1184 seconds hbase(main):020:0> 最终,我的问题是如何只插入数据到列簇analog,类似下面的语句: insert into t_sems_second (rowkey, analog) select 'row1', row('a', '100') ; 或者: insert into t_sems_second (rowkey, analog, status) values( 'row2', row('a', '100'), row(null, NULL) ); 但证明是不行的? 那么,flink sql 1.11 hbase connector支持只插入数据到其中一个列簇吗,还是说实现我的需求,只能定义两个表,每个表只包含一个列簇? -- Sent from: http://apache-flink.147419.n8.nabble.com/ |
Administrator
|
Hi,
目前还不支持这个功能,将来会通过 partial insert [1] 来支持这个功能。 现在只能先定义两个表,每个表只包含一个列簇。 Best, Jark [1]: https://issues.apache.org/jira/browse/FLINK-18726 On Wed, 9 Sep 2020 at 16:22, 大罗 <[hidden email]> wrote: > Hi,我遇到一个问题,我在hive catalog里定义一个hbase connector表,如下: > > CREATE TABLE t_sems_second ( > rowkey string, > status row (val VARCHAR, dqf VARCHAR), > analog row (val VARCHAR, dqf VARCHAR) > ) WITH ( > 'connector' = 'hbase-1.4', > 'table-name' = 't_sems_second', > 'zookeeper.quorum' = > 'dev-hadoop-node-c:2181,dev-hadoop-node-d:2181,dev-hadoop-node-e:2181' > ); > > > 然后,我在flink-sql,运行sql插入数据,没有问题,如下: > insert into t_sems_second (rowkey, analog, status) values( 'row2', row('a', > '100'), row('b', '200') ); > > 如果我尝试把第二个列簇的内容置为空字符串,也是可以,如下: > insert into t_sems_second (rowkey, analog, status) values( 'row3', row('c', > '300'), row('', '') ); > > 但是在hbase查询里,就会显示如下的空字符串: > hbase(main):019:0> scan 't_sems_second' > ROW COLUMN+CELL > > > row2 column=analog:dqf, > timestamp=1599639282193, value=200 > > row2 column=analog:val, > timestamp=1599639282193, value=b > > row2 column=status:dqf, > timestamp=1599639282193, value=100 > > row2 column=status:val, > timestamp=1599639282193, value=a > > * row3 column=analog:dqf, > timestamp=1599639292413, value= > > row3 column=analog:val, > timestamp=1599639292413, value= * > > row3 column=status:dqf, > timestamp=1599639292413, value=300 > > row3 column=status:val, > timestamp=1599639292413, value=c > > 2 row(s) > Took 0.1184 seconds > > > hbase(main):020:0> > > 最终,我的问题是如何只插入数据到列簇analog,类似下面的语句: > insert into t_sems_second (rowkey, analog) select 'row1', row('a', '100') > ; > 或者: > insert into t_sems_second (rowkey, analog, status) values( 'row2', row('a', > '100'), row(null, NULL) ); > > 但证明是不行的? > > 那么,flink sql 1.11 hbase > connector支持只插入数据到其中一个列簇吗,还是说实现我的需求,只能定义两个表,每个表只包含一个列簇? > > > > > > > > -- > Sent from: http://apache-flink.147419.n8.nabble.com/ > |
Free forum by Nabble | Edit this page |