Skip to main content

oh table

Manage tables and background table services.


oh table show

Lists all tables in a database.

FlagRequiredDescription
--lakeYesLake name
--databaseYesDatabase name
oh table show --lake my-lake --database events

oh table service

The table service subgroup manages background operations on a table. All subcommands require --lake, --database, and --table.

Service types: CLUSTER COMPACT CLEAN METASYNC
Trigger modes: ON_DEMAND AUTOMATIC


oh table service create

FlagRequiredDescription
--lake, --database, --tableYesTarget table
--serviceYesCLUSTER, COMPACT, CLEAN, or METASYNC
--trigger-modeYesON_DEMAND or AUTOMATIC
--options KEY=VALUENoWITH clause parameters; repeatable (see Special parameters)

Special parameters

All WITH clause parameters from the CREATE TABLE_SERVICE API are passed via --options KEY=VALUE.

ParameterServiceDescription
cluster.field.namesCLUSTERComma-separated clustering key fields
cluster.layout.strategyCLUSTERLINEAR, HILBERT, or Z-ORDER
cluster.frequencyCLUSTERRun every N commits (automatic mode only)
cluster.bootstrapCLUSTERTrue or False — cluster the full table on first run
compaction.max.bytesCOMPACTMaximum bytes to compact per job
compaction.frequencyCOMPACTRun every N commits (automatic mode only)
cleaner.retention.daysCLEANRetention period for table data
cleaner.frequencyCLEANRun every N commits (automatic mode only)
metasync.catalogsMETASYNCComma-separated catalog names to sync to
<catalogName>.icebergMETASYNCtrue — enable Iceberg sync for a Glue catalog
<catalogName>.iceberg.databaseNameMETASYNCIceberg database name in Glue
<catalogName>.iceberg.tableNameSuffixMETASYNCSuffix appended to the Iceberg table name

Examples

Clustering:

oh table service create \
--lake my-lake --database events --table clicks \
--service CLUSTER \
--trigger-mode AUTOMATIC \
--options cluster.field.names=event_date,user_id \
--options cluster.layout.strategy=LINEAR \
--options cluster.frequency=3 \
--options cluster.bootstrap=True

Compaction:

oh table service create \
--lake my-lake --database events --table clicks \
--service COMPACT \
--trigger-mode AUTOMATIC \
--options compaction.frequency=5

Cleaning:

oh table service create \
--lake my-lake --database events --table clicks \
--service CLEAN \
--trigger-mode AUTOMATIC \
--options cleaner.retention.days=30 \
--options cleaner.frequency=5

MetaSync to multiple catalogs:

oh table service create \
--lake my-lake --database events --table clicks \
--service METASYNC \
--trigger-mode AUTOMATIC \
--options metasync.catalogs=my-glue-catalog,my-snowflake-catalog

MetaSync with Glue Iceberg integration:

oh table service create \
--lake my-lake --database events --table clicks \
--service METASYNC \
--trigger-mode AUTOMATIC \
--options metasync.catalogs=my-glue-catalog \
--options my-glue-catalog.iceberg=true \
--options my-glue-catalog.iceberg.databaseName=my_iceberg_db \
--options my-glue-catalog.iceberg.tableNameSuffix=_iceberg

oh table service alter

Changes the trigger mode or options of an existing service. Uses the same --options keys as create.

FlagRequiredDescription
--lake, --database, --table, --serviceYesTarget service
--trigger-modeYesNew trigger mode
--options KEY=VALUENoWITH clause parameters; repeatable
# Update clustering fields
oh table service alter \
--lake my-lake --database events --table clicks \
--service CLUSTER \
--trigger-mode AUTOMATIC \
--options cluster.field.names=event_date,region,user_id \
--options cluster.layout.strategy=Z-ORDER \
--options cluster.frequency=3

# Update MetaSync catalogs
oh table service alter \
--lake my-lake --database events --table clicks \
--service METASYNC \
--trigger-mode AUTOMATIC \
--options metasync.catalogs=my-glue-catalog,my-unity-catalog

oh table service describe

Describes a single table service.

oh table service describe \
--lake my-lake --database events --table clicks \
--service COMPACT

oh table service show

Lists all services configured on a table.

oh table service show --lake my-lake --database events --table clicks

oh table service show-runs

Lists all runs for a specific table service.

oh table service show-runs \
--lake my-lake --database events --table clicks \
--service COMPACT

oh table service run

Triggers an on-demand service run. Supports an extended set of service types: CLUSTER, COMPACT, CLEAN, METASYNC, AUTOSAVEPOINT, RESTORE.

oh table service run \
--lake my-lake --database events --table clicks \
--service COMPACT

oh table service pause

Pauses an automatic table service.

oh table service pause \
--lake my-lake --database events --table clicks \
--service COMPACT

oh table service resume

Resumes a paused table service.

oh table service resume \
--lake my-lake --database events --table clicks \
--service COMPACT

oh table service cancel

Cancels an in-progress table service run.

oh table service cancel \
--lake my-lake --database events --table clicks \
--service COMPACT

oh table service alter-cluster

Changes which services cluster a table uses.

FlagRequiredDescription
--lake, --database, --tableYesTarget table
--services-clusterYesNew services cluster name
oh table service alter-cluster \
--lake my-lake --database events --table clicks \
--services-cluster prod-v2