Skip to content

Commit

Permalink
Experiment with SQLQueryTestSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
tanelk committed Sep 19, 2020
1 parent cf6c7e9 commit 317f313
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,17 @@ abstract class Optimizer(catalogManager: CatalogManager)
* if necessary, instead of this method.
*/
final override def batches: Seq[Batch] = {
val excludedRulesConf =
SQLConf.get.optimizerExcludedRules.toSeq.flatMap(Utils.stringToSeq)
val excludedRulesConf = {
val excludedRulesConf = SQLConf.get.optimizerExcludedRules.toSeq.flatMap(Utils.stringToSeq)
if (excludedRulesConf.contains("*")) {
defaultBatches.flatMap { batch =>
batch.rules.map(_.ruleName)
}
} else {
excludedRulesConf
}
}

val excludedRules = excludedRulesConf.filter { ruleName =>
val nonExcludable = nonExcludableRules.contains(ruleName)
if (nonExcludable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper

val configSets = configDims.values.foldLeft(Seq(Seq[(String, String)]())) { (res, dim) =>
dim.flatMap { configSet => res.map(_ ++ configSet) }
}
} ++ Seq(Seq(("spark.sql.optimizer.excludedRules", "*")))

configSets.foreach { configSet =>
try {
Expand Down

0 comments on commit 317f313

Please sign in to comment.