tencent cloud

문서Data Lake Compute

ALTER TABLE DROP PARTITION FIELD

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-08-07 17:17:00

Description

Supported engines: Presto and SparkSQL
Applicable table: Native Iceberg tables and external tables
Purpose: Delete a partition field of a data table.

Standard Statement

ALTER TABLE table_name ADD PARTITION partition_column | hidden_partition_spec

hidden_partition_spec:
Supported transformations are:
years(ts): partition by year
months(ts): partition by month
days(ts) or date(ts): equivalent to dateint partitioning
hours(ts) or date_hour(ts): equivalent to dateint and hour partitioning
bucket(N, col): partition by hashed value mod N buckets
truncate(L, col): partition by value truncated to L
Strings are truncated to the given length
Integers and longs truncate to bins: truncate(10, i) produces partitions 0, 10, 20, 30, …

Parameter Description

table_name: Name of the target table
partition_column: Partitioning column.

Example

ALTER TABLE prod.db.sample DROP PARTITION FIELD catalog
ALTER TABLE prod.db.sample DROP PARTITION FIELD bucket(16, id)
ALTER TABLE prod.db.sample DROP PARTITION FIELD truncate(data, 4)
ALTER TABLE prod.db.sample DROP PARTITION FIELD years(ts)
ALTER TABLE prod.db.sample DROP PARTITION FIELD shard



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백