{"record":{"id":"4cee800042cda945","repo":"apache/iceberg","slug":"no-such-table-s-4cee80","errorCode":null,"errorMessage":"No such table: %s","messagePattern":"No such table: (.+?)","errorType":"exception","errorClass":"org.apache.spark.sql.catalyst.analysis.NoSuchTableException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java","lineNumber":179,"sourceCode":"    return CatalogUtil.buildIcebergCatalog(name, optionsMap, conf);\n  }\n\n  /**\n   * Build an Iceberg {@link TableIdentifier} for the given Spark identifier.\n   *\n   * @param identifier Spark's identifier\n   * @return an Iceberg identifier\n   */\n  protected TableIdentifier buildIdentifier(Identifier identifier) {\n    return Spark3Util.identifierToTableIdentifier(identifier);\n  }\n\n  @Override\n  public Table loadTable(Identifier ident) throws NoSuchTableException {\n    try {\n      return load(ident);\n    } catch (org.apache.iceberg.exceptions.NoSuchTableException e) {\n      throw new NoSuchTableException(ident);\n    }\n  }\n\n  @Override\n  public Table loadTable(Identifier ident, String version) throws NoSuchTableException {\n    Table table = loadTable(ident);\n\n    if (table instanceof SparkTable) {\n      SparkTable sparkTable = (SparkTable) table;\n\n      Preconditions.checkArgument(\n          sparkTable.snapshotId() == null && sparkTable.branch() == null,\n          \"Cannot do time-travel based on both table identifier and AS OF\");\n\n      try {\n        return sparkTable.copyWithSnapshotId(Long.parseLong(version));\n      } catch (NumberFormatException e) {\n        SnapshotRef ref = sparkTable.table().refs().get(version);","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java#L161-L197","documentation":"SparkCatalog.loadTable(ident) delegates to load(ident); when the underlying Iceberg catalog throws org.apache.iceberg.exceptions.NoSuchTableException, it is translated into Spark's NoSuchTableException carrying 'No such table: <ident>'. This is the standard 'table does not exist in this catalog' signal.","triggerScenarios":"loadTable(ident) on SparkCatalog where the identifier is not present in the configured catalog (typo, wrong catalog name, table dropped, or namespace omitted).","commonSituations":"Wrong catalog option in spark.sql.catalog.<name> pointing at a different warehouse; reading a table that another job dropped; case-sensitivity issues (spark.sql.caseSensitive off with mixed-case names); failing over to a catalog where the table was never created.","solutions":["Verify the table exists: SHOW TABLES IN <catalog>.<namespace> or catalog.tableExists(ident).","Check the catalog configuration (spark.sql.catalog.<name>...) points at the intended warehouse/URI.","Correct identifier spelling and namespace qualification in the query or Identifier.of(...) call.","If the table was recently created, refresh metadata (spark.catalog.refreshTable / REFRESH TABLE) or recreate the session cache."],"exampleFix":"// before\nTable t = sparkCatalog.loadTable(Identifier.of(new String[]{\"db\"}, \"tbl\")); // NoSuchTableException\n\n// after\nIdentifier id = Identifier.of(new String[]{\"db\"}, \"tbl\");\nif (sparkCatalog.tableExists(id)) {\n  Table t = sparkCatalog.loadTable(id);\n}","handlingStrategy":"try-catch","validationCode":"Identifier ident = Identifier.of(namespace, name);\nboolean exists = sparkCatalog.tableExists(ident);\nif (!exists) {\n  throw new IllegalStateException(\"Table \" + ident + \" not found in catalog; check catalog config and spelling\");\n}","typeGuard":"boolean tableResolvable = sparkCatalog instanceof SparkCatalog && sparkCatalog.tableExists(ident);","tryCatchPattern":"try {\n  Table t = sparkCatalog.loadTable(ident);\n} catch (org.apache.spark.sql.catalyst.analysis.NoSuchTableException e) {\n  // verify SHOW TABLES IN catalog.namespace, catalog options, and identifier casing\n}","preventionTips":["Validate spark.sql.catalog.<name>.type / uri / warehouse settings before workloads run.","Prefer tableExists() checks over raw loadTable in dynamic SQL generation.","Watch for concurrent DROP TABLE jobs when sharing a warehouse across teams.","Remember table identity is catalog-scoped: the same name in another catalog is a different table."],"tags":["spark","catalog","no-such-table","identifier"],"backgroundTag":"resource-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"}