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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/With.scala:
##########
@@ -149,8 +149,14 @@ object CommonExpressionId {
 
 /**
  * A wrapper of common expression to carry the id.
+ *
+ * @param originAlias only used for push down predicates to make it 
idempotent. If it
+ *                    is not none, we should propagate this attribute
  */
-case class CommonExpressionDef(child: Expression, id: CommonExpressionId = new 
CommonExpressionId())
+case class CommonExpressionDef(
+    child: Expression,
+    id: CommonExpressionId = new CommonExpressionId(),
+    originAlias: Option[Alias] = None)

Review Comment:
   Shall we just put an optional `ExprId` here? We can rewrite the original 
`expensive_expr AS col` into `common_expr_attr#fresh_id AS col`, so only the 
attribute id matters.



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