tencent cloud

All product documents
Data Lake Compute
ALTER TABLE DROP PARTITION FIELD
Last updated: 2024-08-07 17:17:00
ALTER TABLE DROP PARTITION FIELD
Last updated: 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


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support