[
https://issues.apache.org/jira/browse/FLINK-33164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17784722#comment-17784722
]
Martijn Visser commented on FLINK-33164:
----------------------------------------
Re-opened to add documentation in apache/flink-connector-base:
main: 2dcaa6a13f6eb76337c2c28a6685a8759fe890a1
v3.0: 87912baee1f75c43a6380867984c91715f201b99
> HBase connector support ignore null value for partial update
> ------------------------------------------------------------
>
> Key: FLINK-33164
> URL: https://issues.apache.org/jira/browse/FLINK-33164
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / HBase
> Affects Versions: hbase-3.0.0
> Reporter: tanjialiang
> Assignee: tanjialiang
> Priority: Major
> Labels: pull-request-available
> Fix For: hbase-3.0.1
>
>
> Sometimes, user want to write data and ignore null value to achieve partial
> update. So i suggest adding an options: sink.ignore-null-value.
>
> {code:java}
> CREATE TABLE hTable (
> rowkey STRING,
> cf1 ROW<q1 STRING, q2 STRING>,
> PRIMARY KEY (rowkey) NOT ENFORCED
> ) WITH (
> 'connector' = 'hbase-2.2',
> 'table-name' = 'default:test',
> 'zookeeper.quorum' = 'localhost:2181',
> 'sink.ignore-null-value' = 'true' -- default is false, true is enabled
> );
> INSERT INTO hTable VALUES('1', ROW('10', 'hello, world'));
> INSERT INTO hTable VALUES('1', ROW('30', CAST(NULL AS STRING))); -- null
> value to cf1.q2
> -- when sink.ignore-null-value is false
> // after first insert
> {rowkey: "1", "cf1": {q1: "10", q2: "hello, world"}}
> // after second insert, cf1.q2 update to null
> {rowkey: "1", "cf1": {q1: "30", q2: "null"}}
> -- when sink.ignore-null-value is true
> // after first insert
> {rowkey: "1", "cf1": {q1: "10", q2: "hello, world"}}
> // after second insert, cf1.q2 is still the old value
> {rowkey: "1", "cf1": {q1: "30", q2: "hello, world"}} {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)