Skip to content

Commit

Permalink
shim
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jun 3, 2024
1 parent cccee7d commit e0bddd6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1590,9 +1590,9 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde with CometExprShim
withInfo(r, "Round not supported prior to Spark 3.3")
None

case r @ Round(_, _, ansiEnabledOrEvalMode) =>
val evalMode = getCometEvalMode(ansiEnabledOrEvalMode)
if (evalMode == CometEvalMode.ANSI && !CometConf.COMET_ANSI_MODE_ENABLED.get) {
case r: Round =>
val cometEvalMode = evalMode(r)
if (cometEvalMode == CometEvalMode.ANSI && !CometConf.COMET_ANSI_MODE_ENABLED.get) {
// https://github.com/apache/datafusion-comet/issues/466
withInfo(
r,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.comet.shims

import org.apache.comet.expressions.CometEvalMode
import org.apache.spark.sql.catalyst.expressions._

/**
Expand All @@ -30,4 +31,6 @@ trait CometExprShim {
def unhexSerde(unhex: Unhex): (Expression, Expression) = {
(unhex.child, Literal(false))
}

def evalMode(r: Round): CometEvalMode.Value = CometEvalMode.LEGACY
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.comet.shims

import org.apache.comet.expressions.CometEvalMode
import org.apache.spark.sql.catalyst.expressions._

/**
Expand All @@ -30,4 +31,6 @@ trait CometExprShim {
def unhexSerde(unhex: Unhex): (Expression, Expression) = {
(unhex.child, Literal(false))
}

def evalMode(r: Round): CometEvalMode.Value = CometEvalMode.LEGACY
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.comet.shims

import org.apache.comet.expressions.CometEvalMode
import org.apache.spark.sql.catalyst.expressions._

/**
Expand All @@ -30,4 +31,6 @@ trait CometExprShim {
def unhexSerde(unhex: Unhex): (Expression, Expression) = {
(unhex.child, Literal(unhex.failOnError))
}

def evalMode(r: Round): CometEvalMode.Value = CometEvalMode.fromBoolean(r.ansiEnabled)
}

0 comments on commit e0bddd6

Please sign in to comment.