{"record":{"id":"6fb02f3463f21408","repo":"apache/iceberg","slug":"view-does-not-exist","errorCode":null,"errorMessage":"View does not exist","messagePattern":"View does not exist","errorType":"exception","errorClass":"NoSuchViewException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java","lineNumber":720,"sourceCode":"        JdbcUtil.namespaceToString(namespace));\n  }\n\n  @Override\n  public void renameView(TableIdentifier from, TableIdentifier to) {\n    if (schemaVersion != JdbcUtil.SchemaVersion.V1) {\n      throw new UnsupportedOperationException(VIEW_WARNING_LOG_MESSAGE);\n    }\n\n    if (from.equals(to)) {\n      return;\n    }\n\n    if (!namespaceExists(to.namespace())) {\n      throw new NoSuchNamespaceException(\"Namespace does not exist: %s\", to.namespace());\n    }\n\n    if (!viewExists(from)) {\n      throw new NoSuchViewException(\"View does not exist\");\n    }\n\n    if (tableExists(to)) {\n      throw new AlreadyExistsException(\"Cannot rename %s to %s. Table already exists\", from, to);\n    }\n\n    if (viewExists(to)) {\n      throw new AlreadyExistsException(\"Cannot rename %s to %s. View already exists\", from, to);\n    }\n\n    int updatedRecords =\n        execute(\n            err -> {\n              if (JdbcUtil.isConstraintViolation(err)) {\n                throw new AlreadyExistsException(\n                    \"Cannot rename %s to %s. View already exists\", from, to);\n              }\n            },","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java#L702-L738","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ncatalog.renameView(from, to); // throws on retry\n\n// after\nif (catalog.viewExists(from)) {\n  catalog.renameView(from, to);\n} else if (catalog.viewExists(to)) {\n  // rename already completed\n}","handlingStrategy":"validation","validationCode":"if (!catalog.viewExists(from)) {\n  // skip or report: source view missing\n  return;\n}\ncatalog.renameView(from, to);","typeGuard":null,"tryCatchPattern":"try {\n  catalog.renameView(from, to);\n} catch (NoSuchViewException e) {\n  // idempotent retry: check if 'to' already exists\n}","preventionTips":["Make rename pipelines idempotent","Check viewExists before rename","Track prior rename completions in workflow state"],"tags":["jdbc","rename","view","not-found"],"backgroundTag":"record-not-found","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"}