Skip to content

Commit

Permalink
test: Expose thrown exception when executing query in CometTPCHQueryS…
Browse files Browse the repository at this point in the history
…uite
  • Loading branch information
viirya committed Feb 22, 2024
1 parent 074b5fd commit f796aad
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,15 @@ class CometTPCHQuerySuite extends QueryTest with CometTPCBase with SQLQueryTestH
(segments(1).trim, segments(2).replaceAll("\\s+$", ""))
}

assertResult(expectedSchema, s"Schema did not match\n$queryString") {
// Expose thrown exception when executing the query
val notMatchedSchemaOutput = if (schema == emptySchema) {
// There might be exception. See `handleExceptions`.
s"Schema did not match\n$queryString\nOutput/Exception: $outputString"
} else {
s"Schema did not match\n$queryString"
}

assertResult(expectedSchema, notMatchedSchemaOutput) {
schema
}
if (shouldSortResults) {
Expand Down

0 comments on commit f796aad

Please sign in to comment.