DROP_PARTITIONS
Drops the specified table partition keys. If the WOS contains table data, DROP_PARTITIONS forces a moveout before it executes the drop operation.
Syntax
DROP_PARTITIONS (
'[[database.]schema.]table‑name',
'min‑range‑value',
'max‑range‑value'
[, 'force‑split']
)
Parameters
| [database.]schema |
Specifies a schema, by default myschema.thisDbObject If you specify a database, it must be the current database. |
| table‑name |
The target table. The table cannot be used as a dimension table in a pre-join projection and cannot have out-of-date (unrefreshed) projections. |
| min‑range‑value
max‑range‑value |
The minimum and maximum value of partition keys to drop, where min‑range‑value must be ≤ max‑range‑value. To drop one partition key, min‑range‑value and max‑range‑value must be equal. |
| force‑split |
Optional Boolean argument, specifies whether to split ROS containers if the range of partition keys spans multiple containers or part of a single container:
|
Privileges
One of the following:
- DBADMIN
- Table owner
- USAGE privileges on the table schema and TRUNCATE privileges on the table
Restrictions
DROP_PARTITIONS returns an error if both of the following conditions are true of the target table:
- The table's partition expression includes a GROUP BY clause—for example, hierarchically partitioned tables.
- The table has projections that aggregate data—for example, live aggregate or Top-K projections.
Examples
See Dropping Partitions in the Administrator's Guide.