Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

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
Help Center/ Data Lake Insight/ Spark SQL Syntax Reference/ Tables/ Table Lifecycle Management/ Disabling or Restoring the Lifecycle of a Table

Disabling or Restoring the Lifecycle of a Table

Updated on 2024-07-04 GMT+08:00

Function

This section describes how to disable or restore the lifecycle of a specified table or partition.

You can disable or restore the lifecycle of a table in either of the following scenarios:
  1. If the lifecycle function has been enabled for a table or partitioned table, the system allows you to disable or restore the lifecycle of the table by changing the value of dli.table.lifecycle.status.
  2. If the lifecycle function is not enabled for a table or partitioned table, the system will add the dli.table.lifecycle.status property to allow you to disable or restore the lifecycle function of the table.

Notes and Constraints

  • The table lifecycle function is currently in the open beta test (OBT) phase. If necessary, contact customer service to whitelist it.
  • The table lifecycle function currently only supports creating tables and versioning tables using Hive and Datasource syntax.
  • The unit of the lifecycle is in days. The value should be a positive integer.
  • The lifecycle can be set only at the table level. The lifecycle specified for a partitioned table applies to all partitions of the table.

Syntax

  • This syntax can be used to disable or restore the lifecycle of a table at the table level.
    1
    ALTER TABLE table_name SET TBLPROPERTIES("dli.table.lifecycle.status"={enable|disable});
    
  • This syntax can be used to disable or restore the lifecycle of a specified table at the table or partition table level.
    1
    ALTER TABLE table_name [pt_spec] LIFECYCLE {enable|disable};
    

Keywords

TBLPROPERTIES: Table properties, which can be used to extend the lifecycle of a table.

Parameters

Table 1 Parameters

Parameter

Mandatory

Description

table_name

Yes

Name of the table whose lifecycle is to be disabled or restored

pt_spec

No

Partition information of the table whose lifecycle is to be disabled or restored. The format is partition_col1=col1_value1, partition_col2=col2_value1.... For a table with multi-level partitions, all partition values must be specified.

enable

No

Restores the lifecycle function of a table or a specified partition.
  • The table and its partitions participate in lifecycle reclamation again. By default, the lifecycle configuration of the current table and its partitions is used.
  • Before enabling the table lifecycle function, it is recommended to modify the lifecycle configuration of the table and its partitions. This will help prevent any accidental data reclamation caused by the previous configuration once the table lifecycle function is enabled.

disable

No

Disables the lifecycle function of a table or a specified partition.

  • Prevents a table and all its partitions from being reclaimed by the lifecycle. It takes priority over restoring the lifecycle of a table and its partitions. That is, when the lifecycle function of a table or a specified partition is disabled, the partition information of the table whose lifecycle is to be disabled or restored is invalid.
  • After the lifecycle function of a table is disabled, the lifecycle configuration of the table and the enable and disable flags of its partitions are retained.
  • After the lifecycle function of a table is disabled, the lifecycle configuration of the table and partitioned table can still be modified.

Example

  • Example 1: Disable the lifecycle function of the test_lifecycle table.
    1
    alter table test_lifecycle SET TBLPROPERTIES("dli.table.lifecycle.status"='disable');
    
  • Example 2: Disable the lifecycle function for the partition whose time is 20230520 in the test_lifecycle table.
    1
    alter table test_lifecycle partition (dt='20230520') LIFECYCLE 'disable';
    
    NOTE:
    • After the lifecycle function of a partitioned table is disabled, the lifecycle function of all partitions within the table will also be disabled.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback