apache/iceberg · error
Cannot use catalog : not a ProcedureCatalog
Error message
Cannot use catalog ${plugin.name}: not a ProcedureCatalog What it means
Thrown by ResolveProcedures' CatalogHelper.asProcedureCatalog when the catalog resolved from a CALL statement is an Iceberg CatalogPlugin but does not implement the ProcedureCatalog interface, meaning it cannot expose or load procedures.
Solutions
- Prefix the CALL with an Iceberg catalog that supports procedures (e.g. CALL my_iceberg_catalog.system.rewrite_data_files(...))
- Check which catalog the procedure belongs to and set/qualify accordingly — not all catalogs implement ProcedureCatalog
- Upgrade the catalog implementation to an Iceberg version that supports procedures if you expected it to
Example fix
// before CALL spark_catalog.system.rewrite_data_files(table => 'db.t') // after CALL iceberg_catalog.system.rewrite_data_files(table => 'db.t')
Defensive patterns
Strategy: validation
Validate before calling
val plugin = spark.sessionState.catalogManager.catalog(catalogName) require(plugin.isInstanceOf[ProcedureCatalog], s"catalog $catalogName does not support procedures")
Try / catch
try { spark.sql(callSql) } catch { case e: AnalysisException if e.getMessage.contains("not a ProcedureCatalog") => // retarget CALL at an Iceberg catalog } Prevention
- Always qualify CALL statements with a procedure-capable Iceberg catalog name
- Check the default catalog setting (spark.sql.default-catalog) when using unqualified CALLs
- Confirm the catalog implementation supports procedures before registering it for CALL usage
When it happens
Trigger: CALL some_catalog.system.some_procedure(...) where some_catalog is a catalog implementation (e.g. a generic Hive/Hadoop/JDBC catalog) that lacks ProcedureCatalog support.
Common situations: Pointing CALL at the wrong catalog (e.g. session/default catalog instead of the Iceberg catalog); using a catalog plugin version that predates procedure support; misconfigured spark.sql.default-catalog.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Could not build name to arg map
- Missing required parameters
- Named and positional arguments cannot be mixed
- Too many arguments for procedure
- Wrong arg type for : cannot cast $argType to $paramType
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/6406bfe175375673.
Report an issue: GitHub.
Appendix: source
Thrown at spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveProcedures.scala:189
case param =>
val normalizedName = param.name.toLowerCase(Locale.ROOT)
ProcedureParameter.optional(normalizedName, param.dataType)
}
}
private def normalizeArgs(args: Seq[CallArgument]): Seq[CallArgument] = {
args.map {
case a @ NamedArgument(name, _) => a.copy(name = name.toLowerCase(Locale.ROOT))
case other => other
}
}
implicit class CatalogHelper(plugin: CatalogPlugin) {
def asProcedureCatalog: ProcedureCatalog = plugin match {
case procedureCatalog: ProcedureCatalog =>
procedureCatalog
case _ =>
throw new AnalysisException(s"Cannot use catalog ${plugin.name}: not a ProcedureCatalog")
}
}
}
View on GitHub (pinned to 86d9c8fc54)