apache/iceberg · error · NoSuchViewException
Invalid view identifier: %s
Error message
Invalid view identifier: %s
What it means
loadView first validates the TableIdentifier against the catalog's identifier validation (isValidIdentifier). If the identifier is invalid for this catalog (e.g. contains disallowed namespace levels), it throws NoSuchViewException('Invalid view identifier') without consulting the metastore.
Source
Thrown at core/src/main/java/org/apache/iceberg/view/BaseMetastoreViewCatalog.java:67
}
@Override
public String name() {
return super.name();
}
@Override
public View loadView(TableIdentifier identifier) {
if (isValidIdentifier(identifier)) {
ViewOperations ops = newViewOps(identifier);
if (ops.current() == null) {
throw new NoSuchViewException("View does not exist: %s", identifier);
} else {
return new BaseView(ops, ViewUtil.fullViewName(name(), identifier));
}
}
throw new NoSuchViewException("Invalid view identifier: %s", identifier);
}
@Override
public ViewBuilder buildView(TableIdentifier identifier) {
return new BaseViewBuilder(identifier);
}
protected class BaseViewBuilder implements ViewBuilder {
private final TableIdentifier identifier;
private final Map<String, String> properties = Maps.newHashMap();
private final List<ViewRepresentation> representations = Lists.newArrayList();
private Namespace defaultNamespace = null;
private String defaultCatalog = null;
private Schema schema = null;
private String location = null;
protected BaseViewBuilder(TableIdentifier identifier) {
Preconditions.checkArgument(View on GitHub (pinned to 86d9c8fc54)
Solutions
- Inspect the identifier: print identifier.namespace() and name() to confirm segmentation
- Use a TableIdentifier from TableIdentifier.of with the correct namespace levels for this catalog
- Validate with catalog-level parsing utilities before calling loadView
Defensive patterns
Strategy: validation
Validate before calling
TableIdentifier ident = TableIdentifier.of(Namespace.of(namespaceLevels), viewName); // build with the exact namespace depth this catalog expects
Try / catch
try { return catalog.loadView(identifier); } catch (NoSuchViewException e) { if (e.getMessage().contains("Invalid")) { fixIdentifier(); } throw e; } Prevention
- Construct TableIdentifier programmatically, not by string splitting
- Check the catalog's expected namespace depth (e.g. 2-level metastores)
- Do not reuse identifiers across different catalog implementations
When it happens
Trigger: Calling loadView with an identifier whose namespace depth or characters are invalid for this catalog implementation (e.g. multi-level namespaces on a two-level metastore).
Common situations: Passing a table identifier built for a different catalog type; string parsing producing wrong namespace segments; using dots inconsistently.
Related errors
- Invalid table identifier: %s
- Invalid identifier: %s
- Namespace %s is not empty. Contains %d view(s).
- Cannot list views for namespace. Namespace does not exist: %
- Cannot rename %s to %s. View does not exist
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/f28220582369296c.
Report an issue: GitHub.