apache/iceberg · error · RuntimeException

Procedure " + ident + " not found

Error message

Procedure " + ident + " not found

What it means

BaseCatalog.loadProcedure looks up a procedure by name via SparkProcedures; if the namespace is valid but no procedure builder is registered for the identifier, it throws RuntimeException 'Procedure <ident> not found'.

Source

Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/BaseCatalog.java:62

  private static final boolean USE_NULLABLE_QUERY_SCHEMA_CTAS_RTAS_DEFAULT = true;

  private boolean useNullableQuerySchema = USE_NULLABLE_QUERY_SCHEMA_CTAS_RTAS_DEFAULT;

  @Override
  public UnboundProcedure loadProcedure(Identifier ident) {
    String[] namespace = ident.namespace();
    String name = ident.name();

    // namespace resolution is case insensitive until we have a way to configure case sensitivity in
    // catalogs
    if (isSystemNamespace(namespace)) {
      ProcedureBuilder builder = SparkProcedures.newBuilder(name);
      if (builder != null) {
        return builder.withTableCatalog(this).build();
      }
    }

    throw new RuntimeException("Procedure " + ident + " not found");
  }

  @Override
  public Identifier[] listProcedures(String[] namespace) {
    if (isSystemNamespace(namespace)) {
      return SparkProcedures.names().stream()
          .map(name -> Identifier.of(namespace, name))
          .toArray(Identifier[]::new);
    } else {
      return new Identifier[0];
    }
  }

  @Override
  public boolean isFunctionNamespace(String[] namespace) {
    // Allow for empty namespace, as Spark's storage partitioned joins look up
    // the corresponding functions to generate transforms for partitioning
    // with an empty namespace, such as `bucket`.

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Check spelling of the procedure name
  2. List available procedures via SparkProcedures.names() or docs and use an existing name
  3. Upgrade the Iceberg Spark runtime if the procedure exists only in newer versions
  4. Confirm you are calling through the right catalog (catalog.system.<proc>)

Example fix

// before
CALL catalog.system.rewritte_data_files(...)
// after
CALL catalog.system.rewrite_data_files(...)
Defensive patterns

Strategy: validation

Validate before calling

Set<String> known = SparkProcedures.names();
if (!known.contains(procName)) {
  throw new IllegalArgumentException("Unknown procedure: " + procName + "; available: " + known);
}

Try / catch

try {
  spark.sql("CALL " + ident);
} catch (RuntimeException e) {
  if (e.getMessage() != null && e.getMessage().contains("not found")) {
    log.error("Procedure not found; check spelling and Iceberg version");
  } else throw e;
}

Prevention

When it happens

Trigger: CALL catalog.system.some_procedure(...) where the procedure name is misspelled or does not exist in this Iceberg version.

Common situations: Typos in CALL statements; using a procedure added in a newer Iceberg release than the runtime jar; calling a procedure not registered for the catalog.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/78b89fa771b7cc68. Report an issue: GitHub.