Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12719#discussion_r62800316
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/AggregateOptimizeSuite.scala
 ---
    @@ -34,18 +34,27 @@ class AggregateOptimizeSuite extends PlanTest {
     
       object Optimize extends RuleExecutor[LogicalPlan] {
         val batches = Batch("Aggregate", FixedPoint(100),
    +      FoldablePropagation,
           RemoveLiteralFromGroupExpressions,
           RemoveRepetitionFromGroupExpressions) :: Nil
       }
     
    +  val testRelation = LocalRelation('a.int, 'b.int, 'c.int)
    +
       test("remove literals in grouping expression") {
    -    val input = LocalRelation('a.int, 'b.int)
    +    val query1 = testRelation.groupBy('a, Literal("1"), Literal(1) + 
Literal(2))(sum('b))
    +    val query2 = testRelation.groupBy('a)(sum('b))
    +    val optimized = Optimize.execute(analyzer.execute(query1))
    +    val correctAnswer = analyzer.execute(query2)
    --- End diff --
    
    a shortcut: `val correctAnswer = query2.analyze`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to