From 9f0c76275d218ef10d549070a5f60693a9aaaa75 Mon Sep 17 00:00:00 2001 From: Xianjin Date: Thu, 18 Apr 2024 14:27:54 +0800 Subject: [PATCH 1/2] chore: Fix NPE when running CometTPCHQueriesList directly --- .../scala/org/apache/spark/sql/CometTPCHQueriesList.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spark/src/test/scala/org/apache/spark/sql/CometTPCHQueriesList.scala b/spark/src/test/scala/org/apache/spark/sql/CometTPCHQueriesList.scala index 3d8e1ed02..3586e240a 100644 --- a/spark/src/test/scala/org/apache/spark/sql/CometTPCHQueriesList.scala +++ b/spark/src/test/scala/org/apache/spark/sql/CometTPCHQueriesList.scala @@ -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( @@ -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") } } From b59fe44c4407cd44c879c36ad8f8bc108471f1ae Mon Sep 17 00:00:00 2001 From: Xianjin Date: Thu, 18 Apr 2024 14:45:31 +0800 Subject: [PATCH 2/2] fix match error. --- .../scala/org/apache/spark/sql/CometTPCQueryListBase.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spark/src/test/scala/org/apache/spark/sql/CometTPCQueryListBase.scala b/spark/src/test/scala/org/apache/spark/sql/CometTPCQueryListBase.scala index 1f28b76a1..ac3c04702 100644 --- a/spark/src/test/scala/org/apache/spark/sql/CometTPCQueryListBase.scala +++ b/spark/src/test/scala/org/apache/spark/sql/CometTPCQueryListBase.scala @@ -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) {