{"record":{"id":"375f0dc589ef20b0","repo":"apache/iceberg","slug":"view-does-not-exist-ident","errorCode":null,"errorMessage":"View does not exist: ident","messagePattern":"View does not exist: ident","errorType":"exception","errorClass":"NoSuchViewException","httpStatus":404,"severity":"error","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java","lineNumber":598,"sourceCode":"          .toArray(Identifier[]::new);\n    }\n\n    return new Identifier[0];\n  }\n\n  @Override\n  public boolean viewExists(Identifier ident) {\n    return asViewCatalog != null && asViewCatalog.viewExists(buildIdentifier(ident));\n  }\n\n  @Override\n  public View loadView(Identifier ident) throws NoSuchViewException {\n    if (null != asViewCatalog) {\n      try {\n        org.apache.iceberg.view.View view = asViewCatalog.loadView(buildIdentifier(ident));\n        return new SparkView(catalogName, view);\n      } catch (org.apache.iceberg.exceptions.NoSuchViewException e) {\n        throw new NoSuchViewException(ident);\n      }\n    }\n\n    throw new NoSuchViewException(ident);\n  }\n\n  @Override\n  public View createView(\n      Identifier ident,\n      String sql,\n      String currentCatalog,\n      String[] currentNamespace,\n      StructType schema,\n      String[] queryColumnNames,\n      String[] columnAliases,\n      String[] columnComments,\n      Map<String, String> properties)\n      throws ViewAlreadyExistsException, NoSuchNamespaceException {","sourceCodeStart":580,"sourceCodeEnd":616,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java#L580-L616","documentation":"SparkCatalog.loadView throws NoSuchViewException when the view catalog cannot load the identifier, or when asViewCatalog is null (catalog does not support views). The identifier in the message is the Spark identifier requested by the caller.","triggerScenarios":"SELECT/DESCRIBE on a view via an Iceberg catalog that supports views (asViewCatalog non-null) but the view does not exist; or any view lookup on a catalog without view support (asViewCatalog null).","commonSituations":"Querying a view that was dropped or renamed; typo or wrong case in the view name; using an older Iceberg runtime/catalog that predates view support with Spark views in the plan; referencing the view in the wrong catalog (spark.sql.defaultCatalog).","solutions":["Verify the view exists: SHOW VIEWS IN <catalog>.<namespace>","Check the fully qualified name including catalog (catalog.namespace.view)","Confirm your Iceberg version and catalog support views (ViewCatalog) — upgrade if needed","Recreate the view with CREATE VIEW if it was dropped"],"exampleFix":"// before\nDataset<Row> df = spark.table(\"prod.reporting.daily_sales\"); // view dropped\n// after\nif (spark.catalog().viewExists(\"prod.reporting.daily_sales\")) {\n  Dataset<Row> df = spark.table(\"prod.reporting.daily_sales\");\n}","handlingStrategy":"try-catch","validationCode":"boolean exists = spark.catalog().viewExists(\"prod.reporting.daily_sales\"); // Spark 3.4+\n// or check the underlying ViewCatalog:\nboolean viewExists = asViewCatalog != null && asViewCatalog.viewExists(ident);","typeGuard":"boolean viewSupported(Catalog catalog) {\n  return catalog instanceof org.apache.iceberg.catalog.ViewCatalog;\n}","tryCatchPattern":"try {\n  View view = sparkCatalog.loadView(ident);\n} catch (NoSuchViewException e) {\n  // view missing: recreate, or route to a fallback table\n}","preventionTips":["Always fully qualify view names: catalog.namespace.view","Confirm the Iceberg Spark runtime version supports views (views need ViewCatalog, Iceberg 1.4+/Spark 3.4+ runtime for this path)","Keep view lineage in migration scripts so dropped views are recreated"],"tags":["spark","view","catalog"],"backgroundTag":"entity-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"}