Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove logTrace
  • Loading branch information
MaxGekk committed Sep 27, 2019
commit cee6709d24c41ebd1c17bad4b2acd26b24d67d08
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,15 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession {
if (!ignoreSet.contains(className)) {
withClue(s"Function '${info.getName}', Expression class '$className'") {
val example = info.getExamples
logTrace(example)
checkExampleSyntax(example)
example.split(" > ").toList.foreach(_ match {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (_ match { can be removed.

case exampleRe(sql, output) =>
val df = spark.sql(sql)
val actual = unindentAndTrim(
hiveResultString(df.queryExecution.executedPlan).mkString("\n"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about checking results with/without codegen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purpose of this test is to check that output of examples is up to date, and matches to current output of spark-sql.
Correctness of examples without codegen should be checked in separate tests for the expression or function, I do believe.

logTrace(s"Actual: $actual")
val expected = unindentAndTrim(output)
logTrace(s"Expected: $expected")
assert(actual === expected)
case notMatched => logTrace(notMatched)
case _ =>
})
}
}
Expand Down