Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/19022#discussion_r134685973
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/LogicalPlanSuite.scala
---
@@ -89,4 +90,14 @@ class LogicalPlanSuite extends SparkFunSuite {
assert(TestBinaryRelation(relation, incrementalRelation).isStreaming
=== true)
assert(TestBinaryRelation(incrementalRelation,
incrementalRelation).isStreaming)
}
+
+ test("getAliasedConstraints") {
+ val expressionNum = 100
+ val aggExpression = (1 to expressionNum).map(i =>
Alias(Count(Literal(1)), s"cnt$i")())
+ val aggPlan = Aggregate(Nil, aggExpression, LocalRelation())
+
+ val expressions = aggPlan.validConstraints
+ // The size of Aliased expression is n * (n - 1) / 2 + n
+ assert( expressions.size === expressionNum * (expressionNum - 1) / 2 +
expressionNum)
--- End diff --
Test on the size of `validConstraints` may be fragile. I think we only need
to test if the new API of `ExpressionSet` works.
---
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]