Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL][WIP] Spark map_concat velox function support #6131

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.apache.gluten.datasource.ArrowConvertorRule
import org.apache.gluten.exception.GlutenNotSupportException
import org.apache.gluten.execution._
import org.apache.gluten.expression._
import org.apache.gluten.expression.ExpressionNames.MAP_CONCAT
import org.apache.gluten.expression.aggregate.{HLLAdapter, VeloxBloomFilterAggregate, VeloxCollectList, VeloxCollectSet}
import org.apache.gluten.extension._
import org.apache.gluten.extension.columnar.TransformHints
Expand Down Expand Up @@ -854,7 +855,8 @@ class VeloxSparkPlanExecApi extends SparkPlanExecApi {
Sig[VeloxCollectList](ExpressionNames.COLLECT_LIST),
Sig[VeloxCollectSet](ExpressionNames.COLLECT_SET),
Sig[VeloxBloomFilterMightContain](ExpressionNames.MIGHT_CONTAIN),
Sig[VeloxBloomFilterAggregate](ExpressionNames.BLOOM_FILTER_AGG)
Sig[VeloxBloomFilterAggregate](ExpressionNames.BLOOM_FILTER_AGG),
Sig[MapConcat](MAP_CONCAT)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,24 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
}
}

test("test map_concat function") {
withTempPath {
path =>
Seq(
Map[String, Int]("a" -> 1, "b" -> 2),
Map[String, Int]("a" -> 2, "b" -> 3),
null
)
.toDF("m")
.write
.parquet(path.getCanonicalPath)
spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("map_tbl")
runQueryAndCompare("select map_concat(m, map('c', 4)) from map_tbl") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}
}

test("zip_with") {
withTempPath {
path =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ object ExpressionNames {
// Map functions
final val CREATE_MAP = "map"
final val GET_MAP_VALUE = "get_map_value"
final val MAP_CONCAT = "map_concat"
final val MAP_KEYS = "map_keys"
final val MAP_VALUES = "map_values"
final val MAP_FROM_ARRAYS = "map_from_arrays"
Expand Down
Loading