From 9697eae338333f81687c2aa9da2ba69fdbc96711 Mon Sep 17 00:00:00 2001 From: Kazantsev Maksim Date: Thu, 30 Jan 2025 20:00:19 +0400 Subject: [PATCH] Merge with master --- .../apache/comet/serde/QueryPlanSerde.scala | 18 +----------------- .../scala/org/apache/comet/serde/arrays.scala | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) 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 0b5951eed..2b6d6d5bb 100644 --- a/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala +++ b/spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala @@ -2366,23 +2366,7 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde with CometExprShim case _: ArrayIntersect => convert(CometArrayIntersect) case _: ArrayJoin => convert(CometArrayJoin) case _: ArraysOverlap => convert(CometArraysOverlap) - case _ if expr.prettyName == "array_except" => - if (CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.get()) { - createBinaryExpr( - expr, - expr.children(0), - expr.children(1), - inputs, - binding, - (builder, binaryExpr) => builder.setArrayExcept(binaryExpr)) - } else { - withInfo( - expr, - s"array_except is not fully compatible with Spark. " + - s"Set ${CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.key}=true " + - "to allow it anyway.") - None - } + case _ if expr.prettyName == "array_except" => convert(CometArrayExcept) case _ => withInfo(expr, s"${expr.prettyName} is not supported", expr.children: _*) None diff --git a/spark/src/main/scala/org/apache/comet/serde/arrays.scala b/spark/src/main/scala/org/apache/comet/serde/arrays.scala index db1679f22..0fad5314e 100644 --- a/spark/src/main/scala/org/apache/comet/serde/arrays.scala +++ b/spark/src/main/scala/org/apache/comet/serde/arrays.scala @@ -126,6 +126,21 @@ object CometArraysOverlap extends CometExpressionSerde with IncompatExpr { } } +object CometArrayExcept extends CometExpressionSerde with IncompatExpr { + override def convert( + expr: Expression, + inputs: Seq[Attribute], + binding: Boolean): Option[ExprOuterClass.Expr] = { + createBinaryExpr( + expr, + expr.children(0), + expr.children(1), + inputs, + binding, + (builder, binaryExpr) => builder.setArrayExcept(binaryExpr)) + } +} + object CometArrayJoin extends CometExpressionSerde with IncompatExpr { override def convert( expr: Expression,