Table services
Manage table services that run on Onehouse tables: clustering, compaction, cleaning, metasync, and (for run_service_in_table only) autosavepoint and restore.
Most methods take the same key arguments — lake, database, table, and service. The valid service values are "CLUSTER", "COMPACT", "CLEAN", "METASYNC". The one exception is run_service_in_table, which also accepts "AUTOSAVEPOINT" and "RESTORE".
Methods
| Method | Description |
|---|---|
create_table_service | Attach a service to a table |
alter_table_service | Change a service's trigger mode or options |
alter_services_cluster_in_table | Move a table's services to a different cluster |
run_service_in_table | Trigger a service run on demand |
pause_table_service | Pause a service |
resume_table_service | Resume a paused service |
cancel_table_service | Cancel a running service |
describe_table_service | Show full configuration for a service |
show_table_services | List all services on a table |
show_runs_in_table_service | List runs for one service |
create_table_service
create_table_service(
*,
lake: str,
database: str,
table: str,
service: str,
trigger_mode: str | None = None,
options: Mapping[str, str] | None = None,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
| Parameter | Required | Type / values |
|---|---|---|
lake | yes | str |
database | yes | str |
table | yes | str |
service | yes | "CLUSTER", "COMPACT", "CLEAN", "METASYNC" |
trigger_mode | no | "AUTOMATIC", "ON_DEMAND" |
options | no | Mapping[str, str] |
Example
client.create_table_service(
lake="analytics",
database="events",
table="page_views",
service="COMPACT",
trigger_mode="AUTOMATIC",
)
alter_table_service
alter_table_service(
*,
lake: str,
database: str,
table: str,
service: str,
trigger_mode: str,
options: Mapping[str, str] | None = None,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
trigger_mode is required here (unlike create_table_service).
Example
client.alter_table_service(
lake="analytics",
database="events",
table="page_views",
service="COMPACT",
trigger_mode="ON_DEMAND",
)
alter_services_cluster_in_table
alter_services_cluster_in_table(
table: str,
*,
lake: str,
database: str,
services_cluster: str,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
table is positional here.
Example
client.alter_services_cluster_in_table(
"page_views",
lake="analytics",
database="events",
services_cluster="services-v2",
)
run_service_in_table
run_service_in_table(
table: str,
*,
lake: str,
database: str,
service: str,
unsafe_raw: bool = False,
timeout: float | None = None,
poll_interval: float | None = None,
)
| Parameter | Required | Type / values |
|---|---|---|
table | yes | str (positional) |
lake | yes | str |
database | yes | str |
service | yes | "CLUSTER", "COMPACT", "CLEAN", "METASYNC", "AUTOSAVEPOINT", "RESTORE" |
Example
client.run_service_in_table(
"page_views",
lake="analytics",
database="events",
service="CLEAN",
)
pause_table_service
pause_table_service(*, lake, database, table, service, unsafe_raw=False, timeout=None, poll_interval=None)
Example
client.pause_table_service(
lake="analytics", database="events", table="page_views", service="COMPACT",
)
resume_table_service
resume_table_service(*, lake, database, table, service, unsafe_raw=False, timeout=None, poll_interval=None)
Example
client.resume_table_service(
lake="analytics", database="events", table="page_views", service="COMPACT",
)
cancel_table_service
cancel_table_service(*, lake, database, table, service, unsafe_raw=False, timeout=None, poll_interval=None)
Example
client.cancel_table_service(
lake="analytics", database="events", table="page_views", service="COMPACT",
)
describe_table_service
describe_table_service(*, lake, database, table, service, unsafe_raw=False, timeout=None, poll_interval=None)
Example
result = client.describe_table_service(
lake="analytics", database="events", table="page_views", service="COMPACT",
)
show_table_services
show_table_services(*, lake, database, table, unsafe_raw=False, timeout=None, poll_interval=None)
Example
result = client.show_table_services(
lake="analytics", database="events", table="page_views",
)
show_runs_in_table_service
show_runs_in_table_service(*, lake, database, table, service, unsafe_raw=False, timeout=None, poll_interval=None)
Example
result = client.show_runs_in_table_service(
lake="analytics", database="events", table="page_views", service="COMPACT",
)