You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by co...@apache.org on 2026/04/08 20:51:25 UTC
(datafusion-comet) branch main updated: chore: reenable `width_bucket` test (#3910)
This is an automated email from the ASF dual-hosted git repository.
comphead pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git
The following commit(s) were added to refs/heads/main by this push:
new fc03f7d4e chore: reenable `width_bucket` test (#3910)
fc03f7d4e is described below
commit fc03f7d4e6e0e127121820175860f7b285b788fb
Author: Oleks V <co...@users.noreply.github.com>
AuthorDate: Wed Apr 8 13:51:21 2026 -0700
chore: reenable `width_bucket` test (#3910)
---
.../spark-3.5/org/apache/comet/shims/CometExprShim.scala | 13 ++++---------
.../spark-4.0/org/apache/comet/shims/CometExprShim.scala | 13 ++++---------
.../resources/sql-tests/expressions/misc/width_bucket.sql | 8 ++++----
3 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/spark/src/main/spark-3.5/org/apache/comet/shims/CometExprShim.scala b/spark/src/main/spark-3.5/org/apache/comet/shims/CometExprShim.scala
index 8e9cb1c07..d9b80ab48 100644
--- a/spark/src/main/spark-3.5/org/apache/comet/shims/CometExprShim.scala
+++ b/spark/src/main/spark-3.5/org/apache/comet/shims/CometExprShim.scala
@@ -26,7 +26,7 @@ import org.apache.comet.CometSparkSessionExtensions.withInfo
import org.apache.comet.expressions.{CometCast, CometEvalMode}
import org.apache.comet.serde.{CommonStringExprs, Compatible, ExprOuterClass, Incompatible}
import org.apache.comet.serde.ExprOuterClass.{BinaryOutputStyle, Expr}
-import org.apache.comet.serde.QueryPlanSerde.exprToProtoInternal
+import org.apache.comet.serde.QueryPlanSerde.{exprToProtoInternal, optExprWithInfo, scalarFunctionExprToProto}
/**
* `CometExprShim` acts as a shim for parsing expressions from different Spark versions.
@@ -82,14 +82,9 @@ trait CometExprShim extends CommonStringExprs {
}
case wb: WidthBucket =>
- withInfo(
- wb,
- "WidthBucket not supported, track https://github.com/apache/datafusion-comet/issues/3561")
- None
-// https://github.com/apache/datafusion-comet/issues/3561
-// val childExprs = wb.children.map(exprToProtoInternal(_, inputs, binding))
-// val optExpr = scalarFunctionExprToProto("width_bucket", childExprs: _*)
-// optExprWithInfo(optExpr, wb, wb.children: _*)
+ val childExprs = wb.children.map(exprToProtoInternal(_, inputs, binding))
+ val optExpr = scalarFunctionExprToProto("width_bucket", childExprs: _*)
+ optExprWithInfo(optExpr, wb, wb.children: _*)
case _ => None
}
diff --git a/spark/src/main/spark-4.0/org/apache/comet/shims/CometExprShim.scala b/spark/src/main/spark-4.0/org/apache/comet/shims/CometExprShim.scala
index bf8406c42..0b7590767 100644
--- a/spark/src/main/spark-4.0/org/apache/comet/shims/CometExprShim.scala
+++ b/spark/src/main/spark-4.0/org/apache/comet/shims/CometExprShim.scala
@@ -29,7 +29,7 @@ import org.apache.comet.CometSparkSessionExtensions.withInfo
import org.apache.comet.expressions.{CometCast, CometEvalMode}
import org.apache.comet.serde.{CommonStringExprs, Compatible, ExprOuterClass, Incompatible}
import org.apache.comet.serde.ExprOuterClass.{BinaryOutputStyle, Expr}
-import org.apache.comet.serde.QueryPlanSerde.exprToProtoInternal
+import org.apache.comet.serde.QueryPlanSerde.{exprToProtoInternal, optExprWithInfo, scalarFunctionExprToProto}
/**
* `CometExprShim` acts as a shim for parsing expressions from different Spark versions.
@@ -104,14 +104,9 @@ trait CometExprShim extends CommonStringExprs {
}
case wb: WidthBucket =>
- withInfo(
- wb,
- "WidthBucket not supported, track https://github.com/apache/datafusion-comet/issues/3561")
- None
-// https://github.com/apache/datafusion-comet/issues/3561
-// val childExprs = wb.children.map(exprToProtoInternal(_, inputs, binding))
-// val optExpr = scalarFunctionExprToProto("width_bucket", childExprs: _*)
-// optExprWithInfo(optExpr, wb, wb.children: _*)
+ val childExprs = wb.children.map(exprToProtoInternal(_, inputs, binding))
+ val optExpr = scalarFunctionExprToProto("width_bucket", childExprs: _*)
+ optExprWithInfo(optExpr, wb, wb.children: _*)
// KnownNotContainsNull is a TaggingExpression added in Spark 4.0 that only
// changes schema metadata (containsNull = false). It has no runtime effect,
diff --git a/spark/src/test/resources/sql-tests/expressions/misc/width_bucket.sql b/spark/src/test/resources/sql-tests/expressions/misc/width_bucket.sql
index 443864abe..7e7375b5b 100644
--- a/spark/src/test/resources/sql-tests/expressions/misc/width_bucket.sql
+++ b/spark/src/test/resources/sql-tests/expressions/misc/width_bucket.sql
@@ -23,15 +23,15 @@ CREATE TABLE test_wb(v double) USING parquet
statement
INSERT INTO test_wb VALUES (0.0), (2.5), (5.0), (7.5), (10.0), (-1.0), (11.0), (NULL)
-query ignore(https://github.com/apache/datafusion-comet/issues/3331)
+query
SELECT v, width_bucket(v, 0, 10, 4) FROM test_wb
-query ignore(https://github.com/apache/datafusion-comet/issues/3331)
+query
SELECT v, width_bucket(v, 10, 0, 4) FROM test_wb
-query ignore(https://github.com/apache/datafusion-comet/issues/3331)
+query
SELECT v, width_bucket(v, 0, 10, 1) FROM test_wb
-- literal arguments
-query ignore(https://github.com/apache/datafusion-comet/issues/3331)
+query
SELECT width_bucket(5.0, 0, 10, 4), width_bucket(0.0, 0, 10, 4), width_bucket(NULL, 0, 10, 4)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org