Skip to content

Commit 5afe1ff

Browse files
committed
Fix scala test.
1 parent 17f6bae commit 5afe1ff

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,21 +795,19 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll {
795795

796796
test("throw errors for non-aggregate attributes with aggregation") {
797797
def checkAggregation(query: String, isInvalidQuery: Boolean = true) {
798-
val logicalPlan = sql(query).queryExecution.logical
799-
800798
if (isInvalidQuery) {
801799
val e = intercept[TreeNodeException[LogicalPlan]](sql(query).queryExecution.analyzed)
802800
assert(
803801
e.getMessage.startsWith("Expression not in GROUP BY"),
804-
"Non-aggregate attribute(s) not detected\n" + logicalPlan)
802+
"Non-aggregate attribute(s) not detected\n")
805803
} else {
806804
// Should not throw
807805
sql(query).queryExecution.analyzed
808806
}
809807
}
810808

811809
checkAggregation("SELECT key, COUNT(*) FROM testData")
812-
checkAggregation("SELECT COUNT(key), COUNT(*) FROM testData", false)
810+
checkAggregation("SELECT COUNT(key), COUNT(*) FROM testData", isInvalidQuery = false)
813811

814812
checkAggregation("SELECT value, COUNT(*) FROM testData GROUP BY key")
815813
checkAggregation("SELECT COUNT(value), SUM(key) FROM testData GROUP BY key", false)

0 commit comments

Comments
 (0)