Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/12719#discussion_r62800448
--- 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 --
please follow the code style for this file:
```
val query = ...
val optimized = ...
val correctAnswer = ...
```
`query1` and `query2` looks weird here.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]