Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jul 5, 2024
1 parent ad2aa77 commit 2f2d435
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ trait CometSQLQueryTestHelper {

private val notIncludedMsg = "[not included in comparison]"
private val clsName = this.getClass.getCanonicalName
protected val emptySchema = StructType(Seq.empty).catalogString
protected val emptySchema: String = StructType(Seq.empty).catalogString

protected def replaceNotIncludedMsg(line: String): String = {
line
Expand Down Expand Up @@ -63,8 +63,6 @@ trait CometSQLQueryTestHelper {
}

val df = session.sql(sql)
df.explain()
df.show()
val schema = df.schema.catalogString
// Get answer, but also get rid of the #1234 expression ids that show up in explain plans
val answer = SQLExecution.withNewExecutionId(df.queryExecution, Some(sql)) {
Expand Down Expand Up @@ -93,7 +91,7 @@ trait CometSQLQueryTestHelper {
// Do not output the logical plan tree which contains expression IDs.
// Also implement a crude way of masking expression IDs in the error message
// with a generic pattern "###".
val msg = if (a.plan.nonEmpty) a.getSimpleMessage else a.getMessage
val msg = a.getMessage
(emptySchema, Seq(a.getClass.getName, msg.replaceAll("#\\d+", "#x")))
case s: SparkException if s.getCause != null =>
// For a runtime exception, it is hard to match because its message contains
Expand Down

0 comments on commit 2f2d435

Please sign in to comment.