{"record":{"id":"f06988f924c5d26d","repo":"apache/iceberg","slug":"invalid-table-identifier-s-f06988","errorCode":null,"errorMessage":"Invalid table identifier: %s","messagePattern":"Invalid table identifier: (.+?)","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":404,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java","lineNumber":1406,"sourceCode":"          properties.get(CatalogProperties.WAREHOUSE_LOCATION));\n    }\n\n    ConfigResponse configResponse =\n        client\n            .withAuthSession(initialAuth)\n            .get(\n                ResourcePaths.config(),\n                queryParams.build(),\n                ConfigResponse.class,\n                RESTUtil.configHeaders(properties),\n                ErrorHandlers.configErrorHandler());\n    configResponse.validate();\n    return configResponse;\n  }\n\n  private void checkIdentifierIsValid(TableIdentifier tableIdentifier) {\n    if (tableIdentifier.namespace().isEmpty()) {\n      throw new NoSuchTableException(\"Invalid table identifier: %s\", tableIdentifier);\n    }\n  }\n\n  private void checkViewIdentifierIsValid(TableIdentifier identifier) {\n    if (identifier.namespace().isEmpty()) {\n      throw new NoSuchViewException(\"Invalid view identifier: %s\", identifier);\n    }\n  }\n\n  private void checkNamespaceIsValid(Namespace namespace) {\n    if (namespace.isEmpty()) {\n      throw new NoSuchNamespaceException(\"Invalid namespace: %s\", namespace);\n    }\n  }\n\n  public void commitTransaction(SessionContext context, List<TableCommit> commits) {\n    Endpoint.check(endpoints, Endpoint.V1_COMMIT_TRANSACTION);\n    List<UpdateTableRequest> tableChanges = Lists.newArrayListWithCapacity(commits.size());","sourceCodeStart":1388,"sourceCodeEnd":1424,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java#L1388-L1424","documentation":"A NoSuchTableException thrown by RESTSessionCatalog.checkIdentifierIsValid when the table identifier's namespace is empty. REST catalog identifiers must have at least a one-level namespace; identifiers without one are invalid and rejected with this message before any request is made.","triggerScenarios":"Calling table APIs (loadTable, tableExists, dropTable, registerTable, etc.) with TableIdentifier.of(...) built from an empty or zero-level namespace, e.g. TableIdentifier.of(\"table\") is fine but a Namespace.of() (empty) identifier is not.","commonSituations":"Parsing user-supplied dot-separated names where the namespace part was dropped; building identifiers programmatically with an empty Namespace; SQL front-ends passing unqualified table names without applying the catalog's default namespace.","solutions":["Qualify the table with at least one namespace level: TableIdentifier.of(Namespace.of(\"ns\"), \"table\").","Apply the catalog's default namespace from its configuration when the user gives an unqualified name.","Guard with identifier.namespace().isEmpty() before calling catalog table operations.","Catch NoSuchTableException if you intend to treat invalid identifiers as 'table absent'."],"exampleFix":"// before\nTableIdentifier ident = TableIdentifier.of(Namespace.of(), \"events\");\ncatalog.loadTable(ident);\n// after\nTableIdentifier ident = TableIdentifier.of(Namespace.of(\"analytics\"), \"events\");\ncatalog.loadTable(ident);","handlingStrategy":"validation","validationCode":"if (identifier == null || identifier.namespace().isEmpty()) { throw new IllegalArgumentException(\"table identifier requires a non-empty namespace: \" + identifier); }","typeGuard":null,"tryCatchPattern":"try { catalog.loadTable(ident); } catch (NoSuchTableException e) { /* invalid or missing identifier */ }","preventionTips":["Always construct TableIdentifier with Namespace.of at least one level","Resolve unqualified user names against the catalog default namespace","Validate identifier.namespace().isEmpty() before any REST table call","Avoid parsing identifiers from raw strings without namespace handling"],"tags":["rest","identifier","validation","namespace"],"backgroundTag":"invalid-identifier","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"}