This is an automated email from the ASF dual-hosted git repository.
chengchengjin 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 477aa6b3c8 [VL] Enable spark function map_filter (#8842)
477aa6b3c8 is described below
commit 477aa6b3c840871da12c82419025035ea490e1be
Author: Jinhai (陈锦海) <[email protected]>
AuthorDate: Mon Mar 3 03:06:13 2025 +0800
[VL] Enable spark function map_filter (#8842)
---
.../gluten/execution/ScalarFunctionsValidateSuite.scala | 16 ++++++++++++++++
docs/velox-backend-support-progress.md | 2 +-
.../apache/gluten/expression/ExpressionMappings.scala | 1 +
.../org/apache/gluten/expression/ExpressionNames.scala | 1 +
4 files changed, 19 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 5a4af560b2..34c90e9077 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
@@ -614,6 +614,22 @@ abstract class ScalarFunctionsValidateSuite extends
FunctionsValidateSuite {
}
}
+ test("map_filter") {
+ withTempPath {
+ path =>
+ Seq((Map("a" -> 1, "b" -> 2, "c" -> 3)))
+ .toDF("m")
+ .write
+ .parquet(path.getCanonicalPath)
+
+
spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("map_tbl")
+
+ runQueryAndCompare("select map_filter(m, (k, v) -> k != 'b') from
map_tbl") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+ }
+ }
+
test("test transform_keys function") {
withTempPath {
path =>
diff --git a/docs/velox-backend-support-progress.md
b/docs/velox-backend-support-progress.md
index 59e809e5f1..691a828db8 100644
--- a/docs/velox-backend-support-progress.md
+++ b/docs/velox-backend-support-progress.md
@@ -313,7 +313,7 @@ Gluten supports 199 functions. (Drag to right to see all
data types)
| map | map | map
| S | | | | | | |
| | | | | | | | |
| | | |
| map_concat | map_concat |
| | | | | | | |
| | | | | | | | |
| | | |
| map_entries | map_entries |
| | | | | | | |
| | | | | | | | |
| | | |
-| map_filter | map_filter | map_filter
| | | | | | | |
| | | | | | | | |
| | | |
+| map_filter | map_filter | map_filter
| S | | | | | | |
| | | | | | | | |
| | | |
| get_map_value | | element_at
| S | | | | | | |
| | | | | | | | |
| S | | |
| map_from_arrays | | map_from_arrays
| S | | | | | | |
| | | | | | | | |
| S | | |
| map_from_entries | map_from_entries |
| | | | | | | |
| | | | | | | | |
| | | |
diff --git
a/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
b/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
index 354ad9ea79..5477abceb3 100644
---
a/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
+++
b/gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala
@@ -264,6 +264,7 @@ object ExpressionMappings {
Sig[MapEntries](MAP_ENTRIES),
Sig[MapZipWith](MAP_ZIP_WITH),
Sig[StringToMap](STR_TO_MAP),
+ Sig[MapFilter](MAP_FILTER),
Sig[TransformKeys](TRANSFORM_KEYS),
Sig[TransformValues](TRANSFORM_VALUES),
// Struct functions
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 2c919cebe9..4ea3227b45 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
@@ -289,6 +289,7 @@ object ExpressionNames {
final val TRANSFORM_KEYS = "transform_keys"
final val TRANSFORM_VALUES = "transform_values"
final val STR_TO_MAP = "str_to_map"
+ final val MAP_FILTER = "map_filter"
// struct functions
final val GET_STRUCT_FIELD = "get_struct_field"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]