Updated on 2024-11-29 GMT+08:00

HBase Output

Overview

The HBase Output operator exports existing fields to specified columns of an HBase Outputtable.

Input and Output

  • Input: fields to be exported
  • Output: HBase table

Parameters

Table 1 Operator parameters description

Parameter

Description

Node Type

Mandatory

Default Value

HBase table type

HBase table type. The options include normal (common HBase table) and phoenix.

enum

Yes

normal

NULL value processing mode

Null value processing mode. Selecting the option button indicates to convert null values to empty strings and save them. Deselecting the option button indicates the data is not saved.

boolean

No

The option button is not selected.

HBase output fields

HBase output information:

  • field name: Names of output fields.
  • table name: HBase table name.
  • column family name: HBase column family name. If it is not configured during HBase/Phoenix table creation, the default value is '0'.
  • column name: HBase column name.
  • type: Field type. If type is set to DATE, TIME, or TIMESTAMP, you must specify a time format. If type is set to other values, the time format is invalid. An example time format is yyyyMMdd HH:mm:ss.
  • length: Field value length. If the actual field value is excessively long, the value is cut based on the configured length. When type is set to CHAR, spaces are added to the field value for supplement if the actual field value length is less than the configured length. When type is set to VARCHAR, no space is added to the field value for supplement if the actual field value length is less than the configured length.
  • Primary Key: Indicates whether a column is a primary key column. A common HBase table can have only one primary key, while a phoenix table can have multiple primary keys. If multiple primary keys are configured, they are combined according to the configuration sequence. At least one primary key column must be configured.

map

Yes

None

Data Processing Rule

  • The field values are exported to the HBase table.
  • When the original data contains NULL values, if the NULL value processing mode is selected, the NULL values are converted to empty strings and saved. If the NULL value processing mode button is not selected, the data is not saved.

Example

Using table input as an example, after the fields are generated, the HBase Output operator exports them to the related HBase table and stores the data in the test table, as shown in the following figure.

Create an HBase table.

create 'hbase_test','f1','f2';

Configure the HBase Output operator, as shown in the following figure.

After the job execution is complete, view the data in the hbase_test table.