JankoWilliam commented on PR #34:
URL: 
https://github.com/apache/flink-connector-hbase/pull/34#issuecomment-1814046099

   Because the hbase sink table is also structured data with fixed fields, the 
'sink. overwrite key' option needs to be used in conjunction with 'sink. ignore 
full value', otherwise deleting the key before adding it is meaningless.for 
example:
   CREATE TABLE hbase_table_ (
    rowkey  STRING,
    cf ROW<q1 INT,q2 INT,q3 INT,q4 INT>,
    PRIMARY KEY (rowkey ) NOT ENFORCED
   ) WITH (
     'connector' = 'my-hbase-2.2',
     'table-name' = 'test_table',
     'sink.ignore-null-value' = 'true', 
     'sink.overwrite-key' = 'true', 
     'zookeeper.quorum' = '127.0.0.1:2181'
   );
   
   insert into hbase_table_ 
   select 
    id AS rowkey ,
    ROW(
    case when q1 <> '0' then cast(q1 as INT) else null end,
    case when q2 <> '0' then cast(q2 as INT) else null end,
    case when q3 <> '0' then cast(q3 as INT) else null end,
    case when q4 <> '0' then cast(q4 as INT) else null end 
   ) as cf
    from kafka_table_ 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to