Skip to content

Commit

Permalink
all plan
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Dec 22, 2024
1 parent b6dcaf0 commit e540843
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1314,13 +1314,13 @@ class Suite implements GroovyInterceptable {
} catch (Throwable t) {
throw new IllegalStateException("Check tag '${tag}' failed, sql:\n${arg}", t)
}
def physicalPlan = ""
def allPlan = ""
if (arg instanceof String) {
def query = (String) arg;
def pattern = Pattern.compile("^\\s*explain\\s+shape\\s*plan\\s*", Pattern.MULTILINE)
if (query =~ pattern) {
def physical = query.replaceAll(pattern, "explain all plan ")
physicalPlan = JdbcUtils.executeToStringList(context.getConnection(), physical)[0].join('\n')
allPlan = JdbcUtils.executeToStringList(context.getConnection(), physical)[0].join('\n')
}
}

Expand All @@ -1330,7 +1330,7 @@ class Suite implements GroovyInterceptable {
def outputFilePath = context.outputFile.getCanonicalPath().substring(context.config.dataPath.length() + 1)
def line = expectCsvResults.currentLine()
logger.warn("expect results in file: ${outputFilePath}, line: ${line}\nrealResults:\n" + csvRealResult)
throw new IllegalStateException("Check tag '${tag}' failed:\n${errorMsg}\n\nsql:\n${arg}\n\nmemo:\n${physicalPlan}")
throw new IllegalStateException("Check tag '${tag}' failed:\n${errorMsg}\n\nsql:\n${arg}\n\n${allPlan}")
}
}

Expand Down

0 comments on commit e540843

Please sign in to comment.