Skip to content

Commit

Permalink
remove COMET_ANSI_MODE_ENABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jun 7, 2024
1 parent fda7b30 commit 1bb6d04
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
9 changes: 0 additions & 9 deletions common/src/main/scala/org/apache/comet/CometConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,6 @@ object CometConf extends ShimCometConf {
.toSequence
.createWithDefault(Seq("Range,InMemoryTableScan"))

val COMET_ANSI_MODE_ENABLED: ConfigEntry[Boolean] = conf("spark.comet.ansi.enabled")
.internal()
.doc(
"Comet does not respect ANSI mode in most cases and by default will not accelerate " +
"queries when ansi mode is enabled. Enable this setting to test Comet's experimental " +
"support for ANSI mode. This should not be used in production.")
.booleanConf
.createWithDefault(COMET_ANSI_MODE_ENABLED_DEFAULT)

val COMET_CAST_ALLOW_INCOMPATIBLE: ConfigEntry[Boolean] =
conf("spark.comet.cast.allowIncompatible")
.doc(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,11 +700,8 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde with CometExprShim
case c @ Cast(child, dt, timeZoneId, _) =>
handleCast(child, inputs, dt, timeZoneId, evalMode(c))

case expr if isUnsupportedAnsiExpr(expr) && !CometConf.COMET_ANSI_MODE_ENABLED.get() =>
withInfo(
expr,
"ANSI mode not supported. " +
s"Set ${CometConf.COMET_ANSI_MODE_ENABLED.key}=true to enable it anyway.")
case expr if isUnsupportedAnsiExpr(expr) =>
withInfo(expr, "ANSI mode not supported")
None

case add @ Add(left, right, _) if supportedDataType(left.dataType) =>
Expand Down
4 changes: 1 addition & 3 deletions spark/src/test/scala/org/apache/comet/CometCastSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -965,9 +965,7 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
}

// with ANSI enabled, we should produce the same exception as Spark
withSQLConf(
(SQLConf.ANSI_ENABLED.key, "true"),
(CometConf.COMET_ANSI_MODE_ENABLED.key, "true")) {
withSQLConf((SQLConf.ANSI_ENABLED.key, "true")) {

// cast() should throw exception on invalid inputs when ansi mode is enabled
val df = data.withColumn("converted", col("a").cast(toType))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,6 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
def withAnsiMode(enabled: Boolean)(f: => Unit): Unit = {
withSQLConf(
SQLConf.ANSI_ENABLED.key -> enabled.toString,
CometConf.COMET_ANSI_MODE_ENABLED.key -> enabled.toString,
CometConf.COMET_ENABLED.key -> "true",
CometConf.COMET_EXEC_ENABLED.key -> "true")(f)
}
Expand Down

0 comments on commit 1bb6d04

Please sign in to comment.