apache/iceberg · error · NoSuchViewException
View does not exist
Error message
View does not exist
What it means
JdbcCatalog.renameView throws NoSuchViewException when the source view (from) does not exist in the catalog. Renaming requires an existing source view; the destination namespace check has already passed at this point.
Source
Thrown at core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java:720
JdbcUtil.namespaceToString(namespace));
}
@Override
public void renameView(TableIdentifier from, TableIdentifier to) {
if (schemaVersion != JdbcUtil.SchemaVersion.V1) {
throw new UnsupportedOperationException(VIEW_WARNING_LOG_MESSAGE);
}
if (from.equals(to)) {
return;
}
if (!namespaceExists(to.namespace())) {
throw new NoSuchNamespaceException("Namespace does not exist: %s", to.namespace());
}
if (!viewExists(from)) {
throw new NoSuchViewException("View does not exist");
}
if (tableExists(to)) {
throw new AlreadyExistsException("Cannot rename %s to %s. Table already exists", from, to);
}
if (viewExists(to)) {
throw new AlreadyExistsException("Cannot rename %s to %s. View already exists", from, to);
}
int updatedRecords =
execute(
err -> {
if (JdbcUtil.isConstraintViolation(err)) {
throw new AlreadyExistsException(
"Cannot rename %s to %s. View already exists", from, to);
}
},View on GitHub (pinned to 86d9c8fc54)
Solutions
- Check catalog.viewExists(from) before renaming; skip if the rename already happened.
- Make rename workflows idempotent: catch NoSuchViewException and verify 'to' exists before treating it as an error.
- Fix typos in the source TableIdentifier.
- Confirm the same catalog instance/name that owns the view is used.
Example fix
// before
catalog.renameView(from, to); // throws on retry
// after
if (catalog.viewExists(from)) {
catalog.renameView(from, to);
} else if (catalog.viewExists(to)) {
// rename already completed
} Defensive patterns
Strategy: validation
Validate before calling
if (!catalog.viewExists(from)) {
// skip or report: source view missing
return;
}
catalog.renameView(from, to); Try / catch
try {
catalog.renameView(from, to);
} catch (NoSuchViewException e) {
// idempotent retry: check if 'to' already exists
} Prevention
- Make rename pipelines idempotent
- Check viewExists before rename
- Track prior rename completions in workflow state
When it happens
Trigger: Calling catalog.renameView(from, to) where viewExists(from) is false — the source view was never created, was already dropped/renamed, or the name is misspelled.
Common situations: Idempotent retry pipelines re-running a rename that already succeeded; concurrent renames/drops; referencing views registered under a different catalog name so viewExists returns false.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Cannot rename %s to %s. View does not exist
- Table does not exist: %s
- Cannot rename %s to %s. Table already exists
- View does not exist: %s
- View does not exist: %s
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/6fb02f3463f21408.
Report an issue: GitHub.