Skip to content

Commit

Permalink
rename config
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed May 7, 2024
1 parent 4f2c26c commit 14d95f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
12 changes: 6 additions & 6 deletions common/src/main/scala/org/apache/comet/CometConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ object CometConf {
.booleanConf
.createWithDefault(false)

val COMET_EXPLAIN_ENABLED: ConfigEntry[String] =
conf("spark.comet.explain")
val COMET_EXPLAIN_FALLBACK_ENABLED: ConfigEntry[Boolean] =
conf("spark.comet.explainFallback.enabled")
.doc(
"Set this config to VERBOSE to see logging explaining the reason(s) why a query " +
"stage cannot be executed natively with Comet.")
.stringConf
.createWithDefault("VERBOSE")
"When this setting is enabled, Comet will provide logging explaining the reason(s) " +
"why a query stage cannot be executed natively with Comet.")
.booleanConf
.createWithDefault(false)

val COMET_BATCH_SIZE: ConfigEntry[Int] = conf("spark.comet.batchSize")
.doc("The columnar batch size, i.e., the maximum number of rows that a batch can contain.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,21 +734,19 @@ class CometSparkSessionExtensions
} else {
var newPlan = transform(plan)

// if the plan cannot be run natively then explain why, if verbose explain is enabled
if (!isCometNative(newPlan)) {
if ("VERBOSE".equals(CometConf.COMET_EXPLAIN_ENABLED.get())) {
new ExtendedExplainInfo().extensionInfo(newPlan) match {
case reasons if reasons.isEmpty =>
logWarning(
"Comet cannot execute this plan natively, but no reason is given. " +
"This is likely a bug.")
case reasons if reasons.size == 1 =>
logWarning(s"Comet cannot execute this plan natively because ${reasons.head}")
case reasons =>
logWarning(
"Comet cannot execute this plan natively because:\n\t- " +
s"${reasons.mkString("\n\t- ")}")
}
// if the plan cannot be run natively then explain why (when appropriate config is enabled)
if (CometConf.COMET_EXPLAIN_FALLBACK_ENABLED.get() && !isCometNative(newPlan)) {
new ExtendedExplainInfo().extensionInfo(newPlan) match {
case reasons if reasons.isEmpty =>
logWarning(
"Comet cannot execute this plan natively, but no reason is given. " +
"This is likely a bug.")
case reasons if reasons.size == 1 =>
logWarning(s"Comet cannot execute this plan natively because ${reasons.head}")
case reasons =>
logWarning(
"Comet cannot execute this plan natively because:\n\t- " +
s"${reasons.mkString("\n\t- ")}")
}
}

Expand Down

0 comments on commit 14d95f1

Please sign in to comment.