dtenedor commented on code in PR #49245:
URL: https://github.com/apache/spark/pull/49245#discussion_r1909562558


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -538,6 +540,13 @@ class Analyzer(override val catalogManager: 
CatalogManager) extends RuleExecutor
             if c.child.resolved && 
AliasResolution.hasUnresolvedAlias(c.metrics) =>
           c.copy(metrics = AliasResolution.assignAliases(c.metrics))
       }
+
+    private def removePipeExpressions(exprs: Seq[NamedExpression]): 
Seq[NamedExpression] =

Review Comment:
   good catch, reverted this change.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/pipeOperators.scala:
##########
@@ -57,6 +66,21 @@ case class PipeExpression(child: Expression, isAggregate: 
Boolean, clause: Strin
   }
 }
 
+/**
+ * Validates and strips PipeExpression nodes from a logical plan once the 
child expressions are
+ * resolved.
+ */
+object ValidateAndStripPipeExpressions extends Rule[LogicalPlan] {
+  def apply(plan: LogicalPlan): LogicalPlan = 
plan.resolveOperatorsUpWithPruning(
+    _.containsPattern(PIPE_EXPRESSION), ruleId) {
+    case node: LogicalPlan =>
+      node.resolveExpressions {
+        case p: PipeExpression if p.child.resolved =>
+          p.checkInvariantsAndRemove

Review Comment:
   good idea, done.



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