pyiceberg_maintenance
Type part of a name or a dotted path
pyiceberg_maintenance
Utilities for generating Apache Iceberg maintenance SQL (``CALL``) statementsfrom Python data structures.Classes
| Name | Description |
|---|---|
RawSQL | A wrapper to inject raw SQL expressions (e.g. TIMESTAMP '...', zorder |
Functions
| Name | Description |
|---|---|
generate_iceberg_call | Generate an Apache Iceberg CALL statement with named arguments. |
Modules
RawSQLclass#
Re-exported from
pyiceberg_maintenance.procedure_builderView sourceclass RawSQL(value: str)A wrapper to inject raw SQL expressions (e.g. TIMESTAMP '...', zorder
expressions) that bypass standard string-quoting so they appear verbatim
in the generated statement. The value is not validated or escaped: only
use trusted SQL expressions and never construct it from untrusted input.
Example::
RawSQL("TIMESTAMP '2021-06-30 00:00:00.000'")valueattributeinstance attribute#
value = valuegenerate_iceberg_callfunction#
Re-exported from
pyiceberg_maintenance.procedure_builderView sourcedef generate_iceberg_call(catalog: str, procedure: str, arguments: Dict[str, Any]) -> strGenerate an Apache Iceberg CALL statement with named arguments.
Parameters
| Name | Type | Description |
|---|---|---|
catalog | str | Spark catalog name (e.g. "spark_catalog" or "hive_prod"). |
procedure | str | Iceberg system procedure name (e.g. "rewrite_data_files"). |
arguments | Dict[str, Any] | Mapping of argument name → value. Values are converted to their
Spark SQL representations by _format_sql_value. Catalog,
procedure, and argument names are emitted as regular or delimited Spark
SQL identifiers. |
Returns
str- A complete one-line
CALLstatement. Example:generate_iceberg_call( … catalog=“spark_catalog”, … procedure=“rewrite_data_files”, … arguments={“table”: “db.sample”}, … ) “CALL spark_catalog.system.rewrite_data_files(table => ‘db.sample’)”