El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

BulkLoad Configuration File

Updated on 2024-10-08 GMT+08:00

Configuring a Custom Combined Rowkey

You can customize combined rowkeys when using the BulkLoad tool to import HBase data in batches. The BulkLoad combines rowkeys by applying rules to process multiple column names and generate new rowkeys.

NOTE:

The column name consists of letters, digits, and underscores (_) and cannot contain any special characters.

The combined rowkey in the configuration.xml file has three parts: for example, the three characters starting from the second character of SMS_ID and SMS_NAME and SMS_SERAIL in reverse order. Each part is connected by an underscore (_).

 <columns> 
                         <column index="1" type="int">SMS_ID</column> 
                         <column index="2" type="string">SMS_NAME</column> 
                         <column index="3" type="string">SMS_ADDRESS</column> 
                 </columns> 

                 <rowkey> 
                        SMS_ID+'_'+substring(SMS_NAME,1,4)+'_'+reverse(SMS_ADDRESS)
                 </rowkey>     
Table 1 Rowkey segment process functions

Syntax

Description

Example Value

format(data,"DataType")

Used to format string data.

For example, format(data,"0.000") is used to input data in "0.000" format.

converse(data,"yyyy-MM-dd","yyyyMMdd")

Used to convert the date format.

For example, converse(data,"yyyy-MM-dd","yyyyMMdd") is used change the date format from "yyyy-MM-dd" to "yyyyMMdd".

rand

Used to generate a random number. Only the int type is supported.

None

replace(data,"A","B")

Used to replace data.

For example, replace(data,"A","B") is used to replace A with B.

reverse(data)

Used to reverse a character string.

For example, reverse(ABC) is used to reverse "ABC" to "CBA".

substring(data,Length1,Length2), or substring(data,Length3)

Used to subtract a string.

For example, substring(data,1,5) or substring(data,3) is used to subtract [1,5) or [3,data.length) from the string.

to_number("data")

Used to convert a string into a numeric value. The Long type numeric value is supported.

For example, to_number("123") is used to convert "123" into 123. data must be a numeric value.

Configuring Custom Rowkeys

You can customize combined rowkeys when using the BulkLoad tool to import HBase data in batches. You can write RowKey implementation code to import data based on the combined RowKeys.

To configure a custom rowkey, perform the following steps:

  1. When you use the implementation class of a custom RowKey, inherit the interface. The JAR file path of the interface is Client installation directory/HBase/hbase/lib/hbase-it-bulk-load-*.jar.

    [com.huawei.hadoop.hbase.tools.bulkload.RowkeyHandlerInterface],

    Implement the method in the interface:

    byte[] getRowkeyBytes(String[] colsValues, RegulationDomain regulation)

    • colsValues indicates a collection of one original data row. Each element is a column.
    • regulation indicates information about the configuration file to be imported. (Typically, this parameter is not used.)

  2. Compress the implementation class and its dependent package into a JAR file, save the file to any location on the node where the HBase client is installed, and ensure that the user who executes the command has the permission to read and execute the JAR file.
  3. When you run the import command, add the following two configuration items:

    -Dimport.rowkey.jar=Full path of the JAR file in step 2

    -Dimport.rowkey.class=Full class name of the user implementation class

Configuring a Custom Combined Field

You can customize combined fields using BulkLoad. Multiple columns are combined into one column in append mode.

NOTE:

The column name consists of letters, digits, and underscores (_) and cannot contain any special characters.

In the following example, the combined field H_COMBINE_1 consists of the SMS_ADDRESS and SMS_SNAME fields.

<!-- Define composite columns --> 
                         <composite family="f2">
                                 <!-- Define the class name of the concatenated field. The class must not exist in the application.-->;
                                 <qualifier class="com.huawei.H_COMBINE_1">H_COMBINE_1</qualifier> 
                                 <columns> 
                                         <column>SMS_ADDRESS</column> 
                                         <column>SMS_NAME</column> 
                                 </columns> 
                         </composite>

Specifying Field Data Types

HBase BulkLoad can read native data files, map the data file fields to HBase fields, and define data types of these fields.

You can define multiple methods in configuration.xml for importing data in batches.

NOTE:

The column name consists of letters, digits, and underscores (_) and cannot contain any special characters.

The following shows the configuration of specifying the data type of a field. In this example, the data types of the SMS_ID, SMS_NAME, and SMS_ADDRESS columns are specified.

                <columns> 
                         <column index="1" type="int">SMS_ID</column> 
                         <column index="2" type="string">SMS_NAME</column> 
                         <column index="3" type="string">SMS_ADDRESS</column> 
                 </columns>
NOTE:

Supported data types are: short, int, long, float, double, boolean, and string.

Defining Inapplicable Data Rows

BulkLoad allows you to specify data rows that are not applicable. These rows are stored in a separate file, rather than in HBase.

You can define multiple methods in configuration.xml for importing data in batches.

NOTE:

The column name consists of letters, digits, and underscores (_) and cannot contain any special characters.

Define the applicable data rows. The following is a configuration example: SMS_ID < 7000 && SMS_NAME = = 'HBase'.

<!-- Define bad line filter rule --> 
<badlines>SMS_ID &lt; 7000 &amp;&amp; SMS_NAME == 'HBase'</badlines>

Table 2 describes the operators and parameter data types in the <badlines> tag.

Table 2 Operators and corresponding data types

Operator Type

Data Type

&&

Boolean

&

Integer

|

Integer

^

Integer

/

Digit

==

String

>=

Digit

>

Digit

<<

Integer

<=

Digit

<

Digit

%

Digit

*

Digit

!=

String

||

Boolean

+

Digit and string

>>

Integer

-

String

>>>

Integer

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback