Read HBase data

This article provides implementation ideas, configuration examples, and verification methods for HBase data reading scenarios, which can be used as a reference for actual project configuration.

Case

Print the data of HBase2.1.0 version

solution

Create a Flink SQL job type and add the following dependencies Download the dependency package for the corresponding version of HBase

20250325144851

The sample sql is as follows:

CREATE TABLE hTable (
   rowkey string,
   cf1 ROW<username STRING, age STRING>
) WITH (
  'connector' = 'hbase-2.2',
  'table-name' = 'ispong_namespace:users',
  'zookeeper.quorum' = '127.0.0.1:2181'
);

CREATE TABLE print_sink ( 
  rowid string,
  username string,
  age string
) WITH ( 
    'connector' = 'print' 
);

INSERT INTO print_sink (rowid,username,age)
SELECT rowkey,cf1.username,cf1.age FROM hTable;