{"record":{"id":"3f22d81c876b6c84","repo":"apache/iceberg","slug":"procedure-ident-not-found","errorCode":null,"errorMessage":"Procedure ${ident} not found","messagePattern":"Procedure (.+?) not found","errorType":"exception","errorClass":"NoSuchProcedureException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/BaseCatalog.java","lineNumber":61,"sourceCode":"  private static final boolean USE_NULLABLE_QUERY_SCHEMA_CTAS_RTAS_DEFAULT = true;\n\n  private boolean useNullableQuerySchema = USE_NULLABLE_QUERY_SCHEMA_CTAS_RTAS_DEFAULT;\n\n  @Override\n  public Procedure loadProcedure(Identifier ident) throws NoSuchProcedureException {\n    String[] namespace = ident.namespace();\n    String name = ident.name();\n\n    // namespace resolution is case insensitive until we have a way to configure case sensitivity in\n    // catalogs\n    if (isSystemNamespace(namespace)) {\n      ProcedureBuilder builder = SparkProcedures.newBuilder(name);\n      if (builder != null) {\n        return builder.withTableCatalog(this).build();\n      }\n    }\n\n    throw new NoSuchProcedureException(ident);\n  }\n\n  @Override\n  public boolean isFunctionNamespace(String[] namespace) {\n    // Allow for empty namespace, as Spark's storage partitioned joins look up\n    // the corresponding functions to generate transforms for partitioning\n    // with an empty namespace, such as `bucket`.\n    // Otherwise, use `system` namespace.\n    return namespace.length == 0 || isSystemNamespace(namespace);\n  }\n\n  @Override\n  public boolean isExistingNamespace(String[] namespace) {\n    return namespaceExists(namespace);\n  }\n\n  @Override\n  public void initialize(String name, CaseInsensitiveStringMap options) {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/BaseCatalog.java#L43-L79","documentation":"BaseCatalog.loadProcedure resolves a procedure by name through SparkProcedures.newBuilder; when the name is not a registered Iceberg procedure it throws NoSuchProcedureException ('Procedure <ident> not found'). Iceberg only registers a fixed set of procedures (e.g. rewrite_data_files, expire_snapshots), so anything else fails lookup.","triggerScenarios":"CALL catalog.system.some_procedure(...) in Spark where some_procedure is not an Iceberg procedure; typo in procedure name; calling a Spark-4.x-only or newer-version procedure on Spark 3.5; invoking a non-Iceberg procedure through the Iceberg catalog instead of the built-in Spark function registry.","commonSituations":"Copy-pasted SQL from docs/blogs referencing a procedure that doesn't exist in the installed Iceberg version; version drift between docs (newer Iceberg) and runtime (older); confusing catalog system procedures with Spark built-in functions.","solutions":["Check spelling and the exact procedure list for your Iceberg/Spark version (org.apache.iceberg.spark.procedures.SparkProcedures).","Upgrade the iceberg-spark runtime to a version that registers the procedure you need.","Route non-Iceberg procedures to Spark's own function/procedure mechanisms instead of catalog.system.","Qualify the CALL correctly: procedures must be invoked on the Iceberg catalog's system namespace, e.g. CALL my_catalog.system.rewrite_data_files(...)."],"exampleFix":"// before\nCALL iceberg.system.compact_table(table => 'db.t');\n// after\nCALL iceberg.system.rewrite_data_files(table => 'db.t');","handlingStrategy":"validation","validationCode":"// Java-side check before emitting CALL SQL\nif (!SparkProcedures.names().contains(procedureName)) {\n  throw new IllegalArgumentException(\"Unknown Iceberg procedure: \" + procedureName);\n}","typeGuard":null,"tryCatchPattern":"try { spark.sql(\"CALL \" + ident); } catch (NoSuchProcedureException e) { /* list available procedures and fail fast with guidance */ }","preventionTips":["Cross-check procedure names against SparkProcedures for your exact Iceberg/Spark version","Pin matching docs versions and runtime jars to avoid version drift","Only call Iceberg procedures on <catalog>.system, not built-in Spark functions"],"tags":["spark","procedure","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}