Skip to main content

Manage Table Partitions

Introduction

This page covers the Gravitino API for partitions. For what a partition is, the partition types, and which catalogs support managing them, see Partitions.

Partition management works on Hive and Doris catalogs. Iceberg, MySQL, and PostgreSQL catalogs manage partitions themselves and do not expose them here.

Partition Operations

Add a Partition

The partition type must match the table's partitioning strategy. The three shapes are below.

{
"type": "identity",
"name": "dt=2026-08-02/country=us",
"fieldNames": [["dt"], ["country"]],
"values": [
{"type": "literal", "dataType": "date", "value": "2026-08-02"},
{"type": "literal", "dataType": "string", "value": "us"}
]
}

values must be in the same order as fieldNames. On a Hive table the partition name is ignored, since Hive derives it from the field names and values.

curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"partitions": [
{
"type": "identity",
"name": "dt=2026-08-02/country=us",
"fieldNames": [["dt"], ["country"]],
"values": [
{"type": "literal", "dataType": "date", "value": "2026-08-02"},
{"type": "literal", "dataType": "string", "value": "us"}
]
}
]
}' http://localhost:8090/api/metalakes/example/catalogs/sales/schemas/public/tables/orders/partitions

Get a Partition

curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
"http://localhost:8090/api/metalakes/example/catalogs/sales/schemas/public/tables/orders/partitions/dt=2026-08-02%2Fcountry=us"

List Partitions

Listing returns names, or full partition objects when details=true is set.

curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
http://localhost:8090/api/metalakes/example/catalogs/sales/schemas/public/tables/orders/partitions

curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
"http://localhost:8090/api/metalakes/example/catalogs/sales/schemas/public/tables/orders/partitions?details=true"

Drop a Partition

curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
"http://localhost:8090/api/metalakes/example/catalogs/sales/schemas/public/tables/orders/partitions/dt=2026-08-02%2Fcountry=us"

Dropping removes the partition metadata. Purging removes its data as well, and is not supported by every catalog.