cloud-fan commented on code in PR #46034: URL: https://github.com/apache/spark/pull/46034#discussion_r1565732326
########## sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/RewriteWithExpressionSuite.scala: ########## @@ -29,25 +29,29 @@ import org.apache.spark.sql.types.IntegerType class RewriteWithExpressionSuite extends PlanTest { object Optimizer extends RuleExecutor[LogicalPlan] { - val batches = Batch("Rewrite With expression", Once, RewriteWithExpression) :: Nil + val batches = Batch("Rewrite With expression", Once, + PullOutGroupingExpressions, + RewriteWithExpression) :: Nil } private val testRelation = LocalRelation($"a".int, $"b".int) private val testRelation2 = LocalRelation($"x".int, $"y".int) test("simple common expression") { val a = testRelation.output.head - val commonExprDef = CommonExpressionDef(a) - val ref = new CommonExpressionRef(commonExprDef) - val plan = testRelation.select(With(ref + ref, Seq(commonExprDef)).as("col")) + val expr = With.create((a, 0)) { case Seq(ref) => Review Comment: does the id matter for this test? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org