Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix NPE when running CometTPCHQueriesList directly #285

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ object CometTPCHQueriesList extends CometTPCQueryListBase with CometTPCQueryBase

// List of all TPC-H queries
val tpchQueries = (1 to 22).map(n => s"q$n")
// Only q1 in the extended queries
val tpchExtendedQueries = Seq("q1")

// If `--query-filter` defined, filters the queries that this option selects
val queries = filterQueries(tpchQueries, benchmarkArgs.queryFilter)
val extendedQueries = filterQueries(tpchExtendedQueries, benchmarkArgs.queryFilter)

if (queries.isEmpty) {
throw new RuntimeException(
Expand All @@ -63,6 +66,6 @@ object CometTPCHQueriesList extends CometTPCQueryListBase with CometTPCQueryBase
setupCBO(cometSpark, benchmarkArgs.cboEnabled, tables)

runQueries("tpch", queries, " TPCH Snappy")
runQueries("tpch-extended", queries, " TPCH Extended Snappy")
runQueries("tpch-extended", extendedQueries, " TPCH Extended Snappy")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ trait CometTPCQueryListBase

val df = cometSpark.sql(queryString)
val cometPlans = mutable.HashSet.empty[String]
stripAQEPlan(df.queryExecution.executedPlan).foreach { case op: CometExec =>
cometPlans += s"${op.nodeName}"
stripAQEPlan(df.queryExecution.executedPlan).foreach {
case op: CometExec =>
cometPlans += s"${op.nodeName}"
case _ =>
}

if (cometPlans.nonEmpty) {
Expand Down
Loading