singhpk234 commented on code in PR #13979:
URL: https://github.com/apache/iceberg/pull/13979#discussion_r2934450209


##########
spark/v4.1/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveViews.scala:
##########
@@ -62,6 +68,48 @@ case class ResolveViews(spark: SparkSession) extends 
Rule[LogicalPlan] with Look
         .map(_ => ResolvedV2View(catalog.asViewCatalog, ident))
         .getOrElse(u)
 
+    case u @ UnResolvedRelationFromView(
+          tableParts @ CatalogAndIdentifier(catalog, tableIdent),
+          viewChain,
+          options,
+          isStreaming) =>
+      // Build List<TableIdentifier> from the view chain.
+      // Each chain element is [catalog, ns1, ns2, ..., viewName] — skip the 
catalog (first element)
+      // since TableIdentifier only contains namespace + name.
+      val viewIdentifiers = viewChain.map { parts =>
+        val nsParts = parts.drop(1).init // drop catalog, then drop name
+        val ns = Namespace.of(nsParts: _*)
+        TableIdentifier.of(ns, parts.last)
+      }
+      val context = new java.util.HashMap[String, Object]()
+      context.put(
+        org.apache.iceberg.catalog.ContextAwareCatalog.VIEW_IDENTIFIER_KEY,
+        viewIdentifiers.asJava)
+      try {
+        catalog match {
+          case contextAwareCatalog: ContextAwareCatalog =>

Review Comment:
   Nice catch, i made the interfaces, forgot to plumb :P 



-- 
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