Skip to main content

Procedures

Paimon procedures expose maintenance and metadata operations through Flink SQL CALL. They are available in Flink 1.18 and later. Some procedures submit Flink jobs; configure the runtime mode and parallelism before calling them. For command-line submission, see Action Jars.

Calling a Procedure​

Select your Paimon catalog with USE CATALOG, or qualify the procedure as catalog_name.sys.procedure_name. Table identifiers in the arguments are normally database_name.table_name.

USE CATALOG my_catalog;
SET 'execution.runtime-mode' = 'batch';

-- Flink 1.19+: use named arguments and omit optional arguments.
CALL sys.compact(`table` => 'default.t', options => 'sink.parallelism=4');

-- Flink 1.18: select a positional signature and keep its argument order.
-- Empty strings stand in for unused string arguments in this signature.
CALL sys.compact('default.t', '', '', '', 'sink.parallelism=4');

Named arguments require Flink 1.19+. On Flink 1.18, use a supported positional signature from the reference; do not replace numeric or Boolean arguments with empty strings. See Flink CALL Statements for SQL syntax.

Argument Conventions​

Argument formMeaningExample
Partition filterCommas combine fields with AND; semicolons separate partitions with OR.dt=2026-09-01,hh=10;dt=2026-09-02,hh=11
Options stringComma-separated key=value pairs.sink.parallelism=4,write-buffer-size=256mb
SQL predicateAn expression accepted by procedures that expose a where argument.`where` => 'dt > 10 AND h < 20'
Signature notation[catalog.] and square-bracketed arguments describe optional syntax. Replace placeholders before execution.[catalog.]sys.compact('table')

Each procedure page lists its arguments, supported signatures, and examples. Requirements and defaults are specific to the procedure.

Procedure Reference​

TaskProcedures
Compaction and Layoutcompact, compact_database, compact_chain_table, compact_manifest, rescale, materialize_deletion_vectors, reassign_row_id
Snapshots and Retentionexpire_snapshots, expire_changelogs, expire_partitions, rollback_to, rollback_to_as_latest, rollback_to_timestamp, rollback_to_watermark, purge_files
Tags and Branchescreate_tag, create_tag_from_timestamp, create_tag_from_watermark, replace_tag, rename_tag, delete_tag, expire_tags, trigger_tag_automatic_creation, create_branch, delete_branch, rename_branch, fast_forward, merge_branch
Table Operationsmerge_into, data_evolution_merge_into, migrate_database, migrate_table, clone, copy_files, alter_column_default_value, drop_partition, mark_partition_done
Indexes and Searchcreate_global_index, drop_global_index, full_text_search, vector_search, rewrite_file_index
Consumers and Query Servicereset_consumer, clear_consumers, query_service
Cleanup and Repairremove_orphan_files, remove_orphan_blobs, remove_unexisting_files, remove_unexisting_manifests, repair, repair_earliest_snapshot
Views and Functionsalter_view_dialect, create_function, alter_function, drop_function