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


##########
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:
   This is great! This skips the tricky aggregate function pushdown stuff from 
Filter/Sort which complicates the analyzer quite a bit. We also don't need this 
with pipe syntax, as it's quite easy for users to filter on the aggregated 
query.



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