vladanvasi-db commented on code in PR #60722:
URL: https://github.com/apache/spark/pull/60722#discussion_r4640396978


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/RelationResolution.scala:
##########
@@ -112,6 +114,85 @@ class RelationResolution(
     Seq(nameParts.last)
   }
 
+  /**
+   * Resolves DDL and miscellaneous command targets to [[ResolvedTable]], 
[[ResolvedTempView]] or
+   * [[ResolvedPersistentView]], without expanding view definitions. Temporary 
views are looked up
+   * before persistent catalog objects.
+   *
+   * When `viewOnly=true`, non-session catalogs that do not implement 
[[ViewCatalog]] are
+   * rejected with MISSING_CATALOG_ABILITY.VIEWS. [[UnresolvedView]] callers 
reject non-view results
+   * downstream via `expectViewNotTableError`.
+   *
+   * Persistent catalog lookup order:
+   *   1. If the catalog is a [[RelationCatalog]], 
[[RelationCatalog.loadRelation]] is called
+   *      once. A returned [[View]] is interpreted as a view; a [[Table]] is a 
table.
+   *      [[NoSuchTableException]] means neither exists.
+   *   2. Otherwise, [[TableCatalog.loadTable]] is tried (when implemented), 
then
+   *      [[ViewCatalog.loadView]] as the fallback view-resolution path (when 
implemented).

Review Comment:
   Fixed both documentation findings in fda39db2e5e: the Scaladoc now explains 
the session catalog’s view-like V1Table handling, and CheckViewReferences names 
RelationResolution.lookupTableOrView. A repository-wide search finds no 
remaining Analyzer.lookupTableOrView reference. Both Catalyst and SQL 
scalastyle pass; executable code is unchanged.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to