This is an automated email from the ASF dual-hosted git repository.
philo 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 997c6e3cd [VL] Add a test to validate substring_index function (#6393)
997c6e3cd is described below
commit 997c6e3cd1ac9095c60accfc8d6856d88be2ca82
Author: Rex(Hui) An <[email protected]>
AuthorDate: Fri Jul 12 13:57:59 2024 +0800
[VL] Add a test to validate substring_index function (#6393)
---
.../execution/ScalarFunctionsValidateSuite.scala | 35 ++++++++++++++++++++++
docs/velox-backend-support-progress.md | 2 +-
2 files changed, 36 insertions(+), 1 deletion(-)
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 cb1d63c90..adb8be51d 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
@@ -1235,4 +1235,39 @@ class ScalarFunctionsValidateSuite extends
FunctionsValidateTest {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}
+
+ test("Test substring_index") {
+ withTempView("substring_index_table") {
+ withTempPath {
+ path =>
+ Seq[(String, String, Int)](
+ ("www.apache.org", ".", 3),
+ ("www.apache.org", ".", 2),
+ ("www.apache.org", ".", 1),
+ ("www.apache.org", ".", 0),
+ ("www.apache.org", ".", -1),
+ ("www.apache.org", ".", -2),
+ ("www.apache.org", ".", -3),
+ ("www.apache.org", "", 1),
+ ("www.apache.org", "#", 1),
+ ("www||apache||org", "||", 2),
+ ("www||apache||org", "||", -2),
+ ("", ".", 1),
+ ("||||||", "|||", 3),
+ ("||||||", "|||", -4)
+ )
+ .toDF("str", "delim", "count")
+ .write
+ .parquet(path.getCanonicalPath)
+
spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("substring_index_table")
+ runQueryAndCompare(
+ """
+ |select substring_index(str, delim, count) from
substring_index_table
+ |""".stripMargin
+ ) {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+ }
+ }
+ }
}
diff --git a/docs/velox-backend-support-progress.md
b/docs/velox-backend-support-progress.md
index 47fc68e4c..8429759fa 100644
--- a/docs/velox-backend-support-progress.md
+++ b/docs/velox-backend-support-progress.md
@@ -185,7 +185,7 @@ Gluten supports 199 functions. (Drag to right to see all
data types)
| startswith | | startsWith
| | | | | | | |
| | | | | | | | |
| | | |
| substr, substring | substr | substring
| S | | | | | | |
| | | | S | | | | |
| | | |
| substring, substr | substr | substring
| S | | | | | | |
| | | | S | | | | |
| | | |
-| substring_index | |
| | | | | | | |
| | | | | | | | |
| | | |
+| substring_index | | substring_index
| S | | | | | | |
| | | | | | | | |
| | | |
| translate | |
| | | | | | | |
| | | | | | | | |
| | | |
| trim | trim | trim
| S | | | | | | |
| | | | S | | | | |
| | | |
| ucase, upper | upper | upper
| S | | | | | | |
| | | | S | | | | |
| | | |
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]