You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by zh...@apache.org on 2024/05/27 09:19:20 UTC

(incubator-gluten) branch main updated: [VL] Enable soundex function (#5877)

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 e128ba708 [VL] Enable soundex function (#5877)
e128ba708 is described below

commit e128ba708156232e0a259b850f4822886a143fb7
Author: Zhen Li <10...@users.noreply.github.com>
AuthorDate: Mon May 27 17:19:15 2024 +0800

    [VL] Enable soundex function (#5877)
    
    [VL] Enable soundex function.
---
 .../src/main/scala/org/apache/gluten/utils/CHExpressionUtil.scala   | 1 +
 .../org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala  | 6 ++++++
 docs/velox-backend-support-progress.md                              | 2 +-
 .../scala/org/apache/gluten/expression/ExpressionMappings.scala     | 1 +
 .../main/scala/org/apache/gluten/expression/ExpressionNames.scala   | 1 +
 5 files changed, 10 insertions(+), 1 deletion(-)

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 5f78d25cc..94d289594 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
@@ -184,6 +184,7 @@ object CHExpressionUtil {
     URL_DECODE -> DefaultValidator(),
     URL_ENCODE -> DefaultValidator(),
     SKEWNESS -> DefaultValidator(),
+    SOUNDEX -> DefaultValidator(),
     BIT_LENGTH -> DefaultValidator(),
     MAKE_YM_INTERVAL -> DefaultValidator(),
     MAP_ZIP_WITH -> 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 f9ec07619..5923d6503 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
@@ -643,6 +643,12 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
     }
   }
 
+  test("soundex") {
+    runQueryAndCompare("select soundex(c_comment) from customer limit 50") {
+      checkGlutenOperatorMatch[ProjectExecTransformer]
+    }
+  }
+
   test("Test make_timestamp function") {
     withTempPath {
       path =>
diff --git a/docs/velox-backend-support-progress.md b/docs/velox-backend-support-progress.md
index ccb253c24..05c76bc47 100644
--- a/docs/velox-backend-support-progress.md
+++ b/docs/velox-backend-support-progress.md
@@ -178,7 +178,7 @@ Gluten supports 199 functions. (Drag to right to see all data types)
 | rpad                          | rpad                   |                       | S      |                          |         |      |       |     |      |       |        |      |           | S      |         |      |        |          |       |     |        |     |
 | rtrim                         | rtrim                  | rtrim                 | S      |                          |         |      |       |     |      |       |        |      |           | S      |         |      |        |          |       |     |        |     |
 | sentences                     |                        |                       |        |                          |         |      |       |     |      |       |        |      |           |        |         |      |        |          |       |     |        |     |
-| soundex                       |                        |                       |        |                          |         |      |       |     |      |       |        |      |           |        |         |      |        |          |       |     |        |     |
+| soundex                       |                        | soundex               | S      |                          |         |      |       |     |      |       |        |      |           |        |         |      |        |          |       |     |        |     |
 | space                         |                        |                       |        |                          |         |      |       |     |      |       |        |      |           |        |         |      |        |          |       |     |        |     |
 | split                         | split                  | split                 | S      | Mismatched               |         |      |       |     |      |       |        |      |           |        |         |      |        |          |       |     |        |     |
 | split_part                    | split_part             |                       |        | Mismatched               |         |      |       |     |      |       |        |      |           |        |         |      |        |          |       |     |        |     |
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 14371a71e..1eade3da6 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
@@ -76,6 +76,7 @@ object ExpressionMappings {
     Sig[Length](LENGTH),
     Sig[Lower](LOWER),
     Sig[Upper](UPPER),
+    Sig[SoundEx](SOUNDEX),
     Sig[StringLocate](LOCATE),
     Sig[StringTrimLeft](LTRIM),
     Sig[StringTrimRight](RTRIM),
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 6e6502c19..be7e32fc9 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
@@ -113,6 +113,7 @@ object ExpressionNames {
   final val LEFT = "left"
   final val REPEAT = "repeat"
   final val TRANSLATE = "translate"
+  final val SOUNDEX = "soundex"
   final val SPACE = "space"
   final val EMPTY2NULL = "empty2null"
   final val INITCAP = "initcap"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org