{"record":{"id":"9715674e2621ca3e","repo":"apache/iceberg","slug":"table-does-not-exist-at-location-s","errorCode":null,"errorMessage":"Table does not exist at location: %s","messagePattern":"Table does not exist at location: (.+?)","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/hadoop/HadoopTables.java","lineNumber":95,"sourceCode":"   *\n   * @param location a path URI (e.g. hdfs:///warehouse/my_table/)\n   * @return table implementation\n   */\n  @Override\n  public Table load(String location) {\n    Table result;\n    Pair<String, MetadataTableType> parsedMetadataType = parseMetadataType(location);\n\n    if (parsedMetadataType != null) {\n      // Load a metadata table\n      result = loadMetadataTable(parsedMetadataType.first(), location, parsedMetadataType.second());\n    } else {\n      // Load a normal table\n      TableOperations ops = newTableOps(location);\n      if (ops.current() != null) {\n        result = new BaseTable(ops, location);\n      } else {\n        throw new NoSuchTableException(\"Table does not exist at location: %s\", location);\n      }\n    }\n\n    LOG.info(\"Table location loaded: {}\", result.location());\n    return result;\n  }\n\n  @Override\n  public boolean exists(String location) {\n    return newTableOps(location).current() != null;\n  }\n\n  /**\n   * Try to resolve a metadata table, which we encode as URI fragments e.g.\n   * hdfs:///warehouse/my_table#snapshots\n   *\n   * @param location Path to parse\n   * @return A base table name and MetadataTableType if a type is found, null if not","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/hadoop/HadoopTables.java#L77-L113","documentation":"HadoopTables.load() throws NoSuchTableException when newTableOps(location).current() returns null, meaning no table metadata (no version-hint/first metadata file) exists at the given location. Iceberg distinguishes 'path exists but not a table' from load failures — this is the not-a-table/absent-table signal.","triggerScenarios":"load() with a path that has no Iceberg metadata under it; typo in the table path; the table was dropped; pointing at the table's data directory instead of its root (or vice versa).","commonSituations":"Hardcoded HDFS paths after a table rename/move; loading a path before table creation completes; using Spark output directory (data files only) as the table location; case-sensitivity or trailing-slash mistakes in the path.","solutions":["Verify the location contains metadata/version-hint.text (hdfs dfs -ls <loc>/metadata)","Correct the path to the table root, not a data or partition subdirectory","Recreate the table if it was dropped","Use catalog.loadTable() instead of raw path loading to avoid path mistakes"],"exampleFix":"// before\nTable t = tables.load(\"hdfs://ns/warehouse/db/table/data\");\n// after\nTable t = tables.load(\"hdfs://ns/warehouse/db/table\"); // root with metadata/","handlingStrategy":"validation","validationCode":"boolean isTable = fs.exists(new Path(location, \"metadata/version-hint.text\"));\nif (!isTable) throw new IllegalArgumentException(\"not an Iceberg table: \" + location);","typeGuard":null,"tryCatchPattern":"try { return tables.load(location); } catch (NoSuchTableException e) { return null; /* or create default */ }","preventionTips":["Validate the path contains a metadata/ directory before loading","Point loads at the table root, never a data subdirectory","Prefer catalog identifiers over raw filesystem paths","Check table existence with tables.exists(location) first"],"tags":["hadoop","nosuchtable","path"],"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-23T08:17:48.524Z"}