HBase

    Supported Version

    In order to set up the HBase Load Node, the following provides dependency information for both projects using a build automation tool (such as Maven or SBT) and SQL Client with Sort Connectors JAR bundles.

    How to create a HBase Load Node

    All the column families in HBase table must be declared as ROW type, the field name maps to the column family name, and the nested field names map to the column qualifier names. There is no need to declare all the families and qualifiers in the schema, users can declare what’s used in the query. Except the ROW type fields, the single atomic type field (e.g. STRING, BIGINT)will be recognized as HBase rowkey. The rowkey field can be arbitrary name, but should be quoted using backticks if it is a reserved keyword.

    1. -- Create a HBase table 'hbase_load_node' in Flink SQL
    2. rowkey STRING,
    3. family1 ROW<q1 INT>,
    4. family2 ROW<q2 STRING, q3 BIGINT>,
    5. family3 ROW<q4 DOUBLE, q5 BOOLEAN, q6 STRING>,
    6. ) WITH (
    7. 'connector' = 'hbase-2.2',
    8. 'table-name' = 'mytable',
    9. 'zookeeper.quorum' = 'localhost:2181'
    10. );
    11. -- assuming the schema of "T" is [rowkey, f1q1, f2q2, f2q3, f3q4, f3q5, f3q6]
    12. SELECT rowkey, ROW(f1q1), ROW(f2q2, f2q3), ROW(f3q4, f3q5, f3q6) FROM T;
    13. -- scan data from the HBase table
    14. SELECT rowkey, family1, family3.q4, family3.q6 FROM hTable;
    15. -- temporal join the HBase table as a dimension table
    16. SELECT * FROM myTopic
    17. LEFT JOIN hTable FOR SYSTEM_TIME AS OF myTopic.proctime

    TODO: It will be supported in the future.

    TODO: It will be supported in the future.

    Data Type Mapping

    When serializing and de-serializing, Flink HBase connector uses utility class org.apache.hadoop.hbase.util.Bytes provided by HBase (Hadoop) to convert Flink Data Types to and from byte arrays.

    Flink HBase connector encodes null values to empty bytes, and decode empty bytes to null values for all data types except string type. For string type, the null literal is determined by null-string-literal option.