From d1b948b903f20ca6a5a9ed64fe6a234a2b878ef4 Mon Sep 17 00:00:00 2001 From: Parth Chandra Date: Mon, 22 Apr 2024 10:18:54 -0700 Subject: [PATCH] fix formatting after rebase --- .../comet/CometSparkSessionExtensions.scala | 10 +++++----- .../org/apache/comet/serde/QueryPlanSerde.scala | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala b/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala index b178a6d26..fc0d1336f 100644 --- a/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala +++ b/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala @@ -201,7 +201,7 @@ class CometSparkSessionExtensions case s: ShuffleExchangeExec if (!s.child.supportsColumnar || isCometPlan( s.child)) && isCometColumnarShuffleEnabled(conf) && -QueryPlanSerde.supportPartitioningTypes(s.child.output)._1 && + QueryPlanSerde.supportPartitioningTypes(s.child.output)._1 && !isShuffleOperator(s.child) => logInfo("Comet extension enabled for JVM Columnar Shuffle") CometShuffleExchangeExec(s, shuffleType = CometColumnarShuffle) @@ -651,7 +651,7 @@ QueryPlanSerde.supportPartitioningTypes(s.child.output)._1 && // convert it to CometColumnarShuffle, case s: ShuffleExchangeExec if isCometShuffleEnabled(conf) && isCometColumnarShuffleEnabled(conf) && -QueryPlanSerde.supportPartitioningTypes(s.child.output)._1 && + QueryPlanSerde.supportPartitioningTypes(s.child.output)._1 && !isShuffleOperator(s.child) => logInfo("Comet extension enabled for JVM Columnar Shuffle") @@ -705,9 +705,9 @@ QueryPlanSerde.supportPartitioningTypes(s.child.output)._1 && if (COMET_ANSI_MODE_ENABLED.get()) { logWarning("Using Comet's experimental support for ANSI mode.") } else { - logInfo("Comet extension disabled for ANSI mode") - return plan - } + logInfo("Comet extension disabled for ANSI mode") + return plan + } } // We shouldn't transform Spark query plan if Comet is disabled. diff --git a/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala b/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala index 26adbde89..0bc2c1d3c 100644 --- a/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala +++ b/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala @@ -537,14 +537,14 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde { case Cast(child, dt, timeZoneId, evalMode) => val childExpr = exprToProtoInternal(child, inputs) if (childExpr.isDefined) { - val evalModeStr = if (evalMode.isInstanceOf[Boolean]) { - // Spark 3.2 & 3.3 has ansiEnabled boolean - if (evalMode.asInstanceOf[Boolean]) "ANSI" else "LEGACY" - } else { - // Spark 3.4+ has EvalMode enum with values LEGACY, ANSI, and TRY - evalMode.toString - } - castToProto(timeZoneId, dt, childExpr, evalModeStr) + val evalModeStr = if (evalMode.isInstanceOf[Boolean]) { + // Spark 3.2 & 3.3 has ansiEnabled boolean + if (evalMode.asInstanceOf[Boolean]) "ANSI" else "LEGACY" + } else { + // Spark 3.4+ has EvalMode enum with values LEGACY, ANSI, and TRY + evalMode.toString + } + castToProto(timeZoneId, dt, childExpr, evalModeStr) } else { withInfo(expr, child) None