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

Enabling and Disabling TTL

Updated on 2024-12-13 GMT+08:00

Function

Enable or disable the TTL of the Hudi table.

Syntax

call ttl_configuration(table => "[table]", path => "[path]", enabled => "[enabled]", strategy => "[strategy]", value => "[value]", resolveConflictsBy => "[resolveConflictsBy]", runInline => "[runInline]")
NOTICE:
  • If strategy is NUM_COMMITS, value indicates that TTL is triggered every [value] commits/deltacommits.
  • If strategy is TIME_ELAPSED, value indicates that TTL is triggered every [value] days.
  • The resolveConflictsBy attribute is used to handle TTL policy conflicts. For example, the dt=2023/05/01 partition is hit by the following two TTL policies:

    Policy A: call ttl_policy_save(table => 'hudi_table', spec => 'dt=2023/05/*', units => 'DAYS', value => '2', level => 'PARTITION');

    Policy B: call ttl_policy_save(table => 'hudi_table', spec => 'dt=2023/05/01', units => 'DAYS', value => '1', level => 'PARTITION');

  • If resolveConflictsBy is MAX_TTL and a partition is hit by multiple TTL policies, the policy with the longest retention period has the highest priority. Policy A takes effect on the dt=2023/05/01 partition, but policy B does not take effect.
  • If resolveConflictsBy is MIN_TTL and a partition is hit by multiple TTL policies, the policy with the shortest retention period has the highest priority. Policy B takes effect on the dt=2023/05/01 partition, but policy A does not take effect.
  • If runInline is true, TTL determines whether to check the TTLs of all partitions based on the values of strategy and value after each write operation is complete. If the TTL needs to be checked and aged partitions are detected, the aged partitions are logically deleted, and the logical deletion operation generates a repalcecommit. When the clean operation is performed, the aged partitions are automatically and physically deleted. If the check is not required, the next write operation is performed.
  • If runInline is false, you do not need to specify strategy or value. TTL checks whether all partitions meet aging conditions during each clean operation. If they do, aged partitions are physically deleted.

Description

Parameter

Description

Mandatory

table

Table name. Database name.Table name is also supported. The value is a string.

No. Specify either table or path.

path

Absolute path of the table. The value is a string.

No. Specify either table or path.

enabled

Whether to enable TTL. The value is a string.

No. The value can be false or true. The default value is false.

strategy

How TTL is defined. The value is a string.

No. The value can be NUM_COMMITS or TIME_ELAPSED. The default value is NUM_COMMITS.

value

TTL triggering interval. The value is a string.

No. The default value is 10.

resolveConflictsBy

Policy to handle TTL conflicts. The value is a string.

No. The value can be MAX_TTL or MIN_TTL. The default value is MAX_TTL.

runInline

Whether the TTL event is triggered when the write operation is complete. The value is a string.

No. The value can be false or true. The default value is false.

Examples

  • Enable TTL for a specified table. The TTL event is triggered every 10 replacecommits.
    call ttl_configuration(table => "hudi_table", enabled => "true", strategy => "NUM_COMMITS", value => "10", resolveConflictsBy => "MAX_TTL", runInline => "true")
  • Enable TTL for a specified path. The TTL event is triggered once every day.
    call ttl_configuration(path => "hdfs://hacluster/user/hive/warehouse/hudi_table/", enabled => "true", strategy => "TIME_ELAPSED", value => "1", resolveConflictsBy => "MIN_TTL", runInline => "true")
  • Enable TTL for a specified table. The TTL event is triggered each time clean is performed.
    call ttl_configuration(table => "hudi_table", enabled => "true", resolveConflictsBy => "MAX_TTL", runInline => "false")
  • Disable TTL.
    call ttl_configuration(table => "hudi_table", enabled => "false")

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