{"record":{"id":"1cf35678761e1cc7","repo":"apache/iceberg","slug":"cannot-find-table-s","errorCode":null,"errorMessage":"Cannot find table %s","messagePattern":"Cannot find table (.+?)","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":null,"severity":"error","filePath":"snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeTableOperations.java","lineNumber":85,"sourceCode":"    return fileIO;\n  }\n\n  @Override\n  protected String tableName() {\n    return fullTableName;\n  }\n\n  @VisibleForTesting\n  String fullTableName() {\n    return tableName();\n  }\n\n  private String loadTableMetadataLocation() {\n    SnowflakeTableMetadata metadata =\n        snowflakeClient.loadTableMetadata(snowflakeIdentifierForTable);\n\n    if (metadata == null) {\n      throw new NoSuchTableException(\"Cannot find table %s\", snowflakeIdentifierForTable);\n    }\n\n    if (!metadata.getStatus().equals(\"success\")) {\n      LOG.warn(\n          \"Got non-successful table metadata: {} with metadataLocation {} for table {}\",\n          metadata.getStatus(),\n          metadata.icebergMetadataLocation(),\n          snowflakeIdentifierForTable);\n    }\n\n    return metadata.icebergMetadataLocation();\n  }\n}\n","sourceCodeStart":67,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/snowflake/src/main/java/org/apache/iceberg/snowflake/SnowflakeTableOperations.java#L67-L99","documentation":"SnowflakeTableOperations.loadTableMetadataLocation calls the Snowflake client to load the table's Iceberg metadata pointer, and throws NoSuchTableException('Cannot find table %s') when Snowflake returns null — i.e. no Iceberg table metadata exists for that identifier. It surfaces as the standard Iceberg 'table not found' signal to上层 catalog/scan code.","triggerScenarios":"Accessing table.location()/refresh()/operations on a TableIdentifier that does not exist in Snowflake; identifier namespace parts not matching the Snowflake DATABASE.SCHEMA.TABLE fully-qualified name; table dropped between listing and loading.","commonSituations":"Typo or wrong catalog name resolution leading to a fully-qualified Snowflake identifier that doesn't exist; querying a table in a different database/schema than configured; race with DROP TABLE; case-sensitivity mismatch on Snowflake identifiers.","solutions":["Verify the table exists in Snowflake with SHOW ICEBERG TABLES / SELECT in the exact DATABASE.SCHEMA.TABLE the identifier maps to.","Check catalog configuration (catalog name, database/schema mapping) so TableIdentifier namespaces resolve to the correct Snowflake identifiers.","Handle NoSuchTableException in callers (catalog.table() returns null or throws per engine semantics) and use catalog.tableExists() before direct operations access.","Watch identifier case: Snowflake stores uppercase names by default; quote or normalize identifiers to match."],"exampleFix":"// before\nTable t = catalog.loadTable(TableIdentifier.of(\"db\", \"missing\"));\n// after\nTableIdentifier ident = TableIdentifier.of(\"db\", \"missing\");\nif (!catalog.tableExists(ident)) {\n  LOG.warn(\"Table {} not found in Snowflake catalog\", ident);\n  return null;\n}\nTable t = catalog.loadTable(ident);","handlingStrategy":"validation","validationCode":"if (!catalog.tableExists(identifier)) {\n  throw new NoSuchTableException(\"Table %s does not exist\", identifier);\n}","typeGuard":null,"tryCatchPattern":"try { table = catalog.loadTable(ident); } catch (NoSuchTableException e) { LOG.warn(\"Table {} missing in Snowflake\", ident); return Optional.empty(); }","preventionTips":["Confirm the fully-qualified Snowflake DATABASE.SCHEMA.TABLE mapping for your identifier","Respect Snowflake identifier case (default uppercase); normalize names","Handle drop races: treat NoSuchTableException as expected in pipelines"],"tags":["no-such-table","snowflake","resource-not-found"],"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-23T08:17:48.524Z"}