{"record":{"id":"4eba528b9167bbf6","repo":"apache/iceberg","slug":"nosuchviewexception-ident-4eba52","errorCode":null,"errorMessage":"NoSuchViewException(ident)","messagePattern":"NoSuchViewException\\(ident\\)","errorType":"exception","errorClass":"NoSuchViewException","httpStatus":null,"severity":"error","filePath":"spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java","lineNumber":456,"sourceCode":"\n    return new Identifier[0];\n  }\n\n  @Override\n  public boolean viewExists(Identifier ident) {\n    return (asViewCatalog != null && asViewCatalog.viewExists(ident))\n        || (isViewCatalog() && getSessionCatalog().viewExists(ident));\n  }\n\n  @Override\n  public View loadView(Identifier ident) throws NoSuchViewException {\n    if (null != asViewCatalog && asViewCatalog.viewExists(ident)) {\n      return asViewCatalog.loadView(ident);\n    } else if (isViewCatalog() && getSessionCatalog().viewExists(ident)) {\n      return getSessionCatalog().loadView(ident);\n    }\n\n    throw new NoSuchViewException(ident);\n  }\n\n  @Override\n  public View createView(ViewInfo viewInfo)\n      throws ViewAlreadyExistsException, NoSuchNamespaceException {\n    if (viewInfo == null) {\n      return null;\n    }\n\n    if (null != asViewCatalog) {\n      return asViewCatalog.createView(viewInfo);\n    } else if (isViewCatalog()) {\n      return getSessionCatalog().createView(viewInfo);\n    }\n\n    throw new UnsupportedOperationException(\n        \"Creating a view is not supported by catalog: \" + catalogName);\n  }","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java#L438-L474","documentation":"Thrown by SparkSessionCatalog.loadView when neither the Iceberg view catalog nor the session catalog reports viewExists(ident) true, so the requested view cannot be resolved anywhere. Analogous to NoSuchTableException but for views.","triggerScenarios":"SELECT or DESCRIBE VIEW on a view identifier that does not exist in the configured view catalog nor in the delegate session catalog.","commonSituations":"View created in a different catalog than the one queried; view dropped or renamed by another process; case-sensitivity mismatch in view name; view support not configured (no view catalog registered).","solutions":["Check the fully qualified view identifier and the catalog it lives in (SHOW VIEWS IN <catalog>.<ns>).","Recreate the view if it was dropped, or create it with CREATE VIEW.","Ensure view support is available: the session catalog must be a ViewCatalog or an Iceberg ViewCatalog must be configured."],"exampleFix":"// before\nSELECT * FROM prod.db.report_view  -- view never created\n// after\nCREATE VIEW prod.db.report_view AS SELECT ...;\nSELECT * FROM prod.db.report_view","handlingStrategy":"validation","validationCode":"if (!catalog.viewExists(Identifier.of(new String[] {\"db\"}, \"report_view\"))) {\n  throw new IllegalArgumentException(\"view does not exist\");\n}","typeGuard":"boolean viewResolvable(ViewCatalog c, Identifier ident) { return c.viewExists(ident); }","tryCatchPattern":"try { catalog.loadView(ident); } catch (NoSuchViewException e) { /* create the view or fix identifier */ }","preventionTips":["Always use fully qualified catalog.view identifiers in queries.","Verify the view lives in the catalog you are querying.","Keep view names case-consistent with creation."],"tags":["spark","catalog","views","view-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-14T16:17:12.679Z"}