cloud-fan commented on code in PR #48091:
URL: https://github.com/apache/spark/pull/48091#discussion_r1766917843


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -5854,7 +5854,20 @@ class AstBuilder extends DataTypeAstBuilder
         windowClause = null,
         relation = left,
         isPipeOperatorSelect = true)
-    }.get
+    }.getOrElse(Option(ctx.whereClause).map { c =>
+      // Add a table subquery boundary between the new filter and the input 
plan if one does not
+      // already exist. This helps the analyzer behave as if we had added the 
WHERE clause after a
+      // table subquery containing the input plan.

Review Comment:
   ah, it also fixes a regression. We can add a test for `table t |> where 
spark_catalog.default.t.x = 1`, which didn't work before this fix.



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