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
On this page

Show all

Submitting a Flink SQL Job in DLI Using Hudi

Updated on 2025-02-22 GMT+08:00

This section describes how to submit a Flink SQL job in DLI using Hudi.

For details about the syntax, see Flink OpenSource SQL 1.15 Syntax Overview.

Log in to the DLI management console. In the navigation pane on the left, choose Job Management > Flink Jobs.

  1. Create a Flink job. Specifically, click Create Job in the upper right corner. In the dialog box that appears, set Type to Flink OpenSource SQL and enter a name.
  2. Write Flink SQL statements (without using catalogs).

    Here, the sink table points to the Hudi table path by creating a temporary table to write data, and the table parameters are configured with hive_sync related parameters to synchronize metadata to the metadata service provided by DLI in real-time. (See the Flink parameters section for specific parameters.)

    Modify the path parameter of the sink table in the job to the desired OBS path for saving the Hudi table.
    -- Temporary table as the source, using datagen to mock data
    create table
      orderSource (
        order_id STRING,
        order_name STRING,
        order_time TIMESTAMP(3)
      )
    with
      ('connector' = 'datagen', 'rows-per-second' = '1');
    
    -- Create a Hudi temporary table as the sink, configuring hms to synchronize the table to DLI metadata service.
    CREATE TABLE
      hudi_table (
        order_id STRING PRIMARY KEY NOT ENFORCED,
        order_name STRING,
        order_time TIMESTAMP(3),
        order_date String
      ) PARTITIONED BY (order_date)
    WITH
      (
        'connector' = 'hudi',
        'path' = 'obs://bucket/path/hudi_table',
        'table.type' = 'MERGE_ON_READ',
        'hoodie.datasource.write.recordkey.field' = 'order_id',
        'write.precombine.field' = 'order_time',
        'hive_sync.enable' = 'true',
        'hive_sync.mode' = 'hms',
        'hive_sync.table' = 'hudi_table',
        'hive_sync.db' = 'default'
      );
    
    -- Execute the insert statement to read from the source table and write to the sink.
    insert into
      hudi_table
    select
      order_id,
      order_name,
      order_time,
      DATE_FORMAT (order_time, 'yyyyMMdd')
    from
      orderSource;

  3. Set job running parameters.

    • Select a queue and configure the Flink version to at least 1.15.
    • Configure an agency with sufficient permissions.
    • Configure an OBS bucket.
    • Enable checkpointing. Checkpointing must be enabled when using Hudi.

  4. Submit the job and check the FlinkUI and logs.

    Click Submit in the upper right corner of the page. Confirm the parameters are correct on the displayed page, then click Start at the bottom. After submission, the Flink job page is displayed, where you can filter the recently submitted Flink job and check its execution status.

    Click the job name to navigate to the job page. Here you can click the Commit Logs or Run Log tab to check the aggregated logs. You can also directly click the Logs tab, select JobManager or TaskManager, and download the corresponding logs.

    Click More in the upper right corner of the page and select FlinkUI to navigate to the FlinkUI for the job.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback