Skip to content

Commit

Permalink
More case
Browse files Browse the repository at this point in the history
  • Loading branch information
baibaichen committed Jun 18, 2024
1 parent b9a76c2 commit f98cf58
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import org.apache.spark.SparkConf
import org.apache.spark.benchmark.Benchmark
import org.apache.spark.internal.Logging
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.util.Utils

object TaoboParseBenchmark extends SqlBasedBenchmark with Logging {
Expand Down Expand Up @@ -85,13 +84,23 @@ object TaoboParseBenchmark extends SqlBasedBenchmark with Logging {
source => source.mkString}))
.foreach {
case (name, sql) =>
benchmark.addCase(name, executedCnt) {
benchmark.addCase(s"[ Analyze]$name", executedCnt) {
_ =>
spark.sql(sql).queryExecution.assertAnalyzed()

}
benchmark.addCase(s"[Optimize]$name", executedCnt) {
_ =>
val x = spark.sql(sql).queryExecution.optimizedPlan
require(x.analyzed)
}
benchmark.addCase(s"[Physical]$name", executedCnt) {
_ =>
val y = spark.sql(sql).queryExecution.sparkPlan
require(y.isInstanceOf[SparkPlan])
require(y != null)

}
}

Utils.tryWithSafeFinally {
tableNames
.map(schemaFileName)
Expand Down

0 comments on commit f98cf58

Please sign in to comment.