This is an automated email from the ASF dual-hosted git repository.
zhli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new d74fc97cf [VL] Enable rint function (#5791)
d74fc97cf is described below
commit d74fc97cf941759c79f440b0df5c5071655b984e
Author: Zhen Li <[email protected]>
AuthorDate: Mon May 20 20:33:06 2024 +0800
[VL] Enable rint function (#5791)
[VL] Enable rint function.
---
.../scala/org/apache/gluten/utils/CHExpressionUtil.scala | 3 ++-
.../gluten/execution/ScalarFunctionsValidateSuite.scala | 12 ++++++++++++
docs/velox-backend-support-progress.md | 2 +-
.../org/apache/gluten/expression/ExpressionMappings.scala | 1 +
.../scala/org/apache/gluten/expression/ExpressionNames.scala | 1 +
5 files changed, 17 insertions(+), 2 deletions(-)
diff --git
a/backends-clickhouse/src/main/scala/org/apache/gluten/utils/CHExpressionUtil.scala
b/backends-clickhouse/src/main/scala/org/apache/gluten/utils/CHExpressionUtil.scala
index f593e5fac..8454b1469 100644
---
a/backends-clickhouse/src/main/scala/org/apache/gluten/utils/CHExpressionUtil.scala
+++
b/backends-clickhouse/src/main/scala/org/apache/gluten/utils/CHExpressionUtil.scala
@@ -199,6 +199,7 @@ object CHExpressionUtil {
UNIX_MICROS -> DefaultValidator(),
TIMESTAMP_MILLIS -> DefaultValidator(),
TIMESTAMP_MICROS -> DefaultValidator(),
- FLATTEN -> DefaultValidator()
+ FLATTEN -> DefaultValidator(),
+ RINT -> DefaultValidator()
)
}
diff --git
a/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
b/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
index e88e9699a..cba8b6207 100644
---
a/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
+++
b/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
@@ -985,4 +985,16 @@ class ScalarFunctionsValidateSuite extends
FunctionsValidateTest {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}
+
+ test("rint") {
+ withTempPath {
+ path =>
+ Seq(1.2, 1.5, 1.9).toDF("d").write.parquet(path.getCanonicalPath)
+
+
spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("double")
+ runQueryAndCompare("select rint(d) from double") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+ }
+ }
}
diff --git a/docs/velox-backend-support-progress.md
b/docs/velox-backend-support-progress.md
index 8b640c081..b8acce266 100644
--- a/docs/velox-backend-support-progress.md
+++ b/docs/velox-backend-support-progress.md
@@ -245,7 +245,7 @@ Gluten supports 199 functions. (Drag to right to see all
data types)
| rand | rand | rand
| S | | | | | | |
| | | | | | | | |
| | | |
| rand | rand | rand
| | | | | | | |
| | | | | | | | |
| | | |
| random | random |
| S | | | | | | |
| | | | | | | | |
| | | |
-| rint | |
| | | | | | | |
| | | | | | | | |
| | | |
+| rint | | rint
|S | | | | | | |
| | | | | | | |
| | | | |
| round | round | round
| S | | | S | S | S | S | S
| S | | | | | | | |
| | | |
| shiftleft | bitwise_left_shift | shiftleft
| S | | | S | S | S | S | S
| S | | | | | | | |
| | | |
| shiftright | bitwise_right_shift | shiftright
| S | | | S | S | S | S | S
| S | | | | | | | |
| | | |
diff --git
a/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
b/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
index 1592b0b9a..f910c8a98 100644
---
a/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
+++
b/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
@@ -148,6 +148,7 @@ object ExpressionMappings {
Sig[Remainder](REMAINDER),
Sig[Factorial](FACTORIAL),
Sig[Rand](RAND),
+ Sig[Rint](RINT),
// PrestoSQL Math functions
Sig[Acos](ACOS),
Sig[Asin](ASIN),
diff --git
a/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala
b/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala
index 735bb7a23..1b73b2686 100644
---
a/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala
+++
b/shims/common/src/main/scala/org/apache/gluten/expression/ExpressionNames.scala
@@ -175,6 +175,7 @@ object ExpressionNames {
final val REMAINDER = "modulus"
final val FACTORIAL = "factorial"
final val RAND = "rand"
+ final val RINT = "rint"
// PrestoSQL Math functions
final val ACOS = "acos"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]