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

[GLUTEN-4039][VL] support map_keys and map_values #4826

Merged
merged 5 commits into from
Mar 4, 2024
Merged
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 @@ -385,6 +385,46 @@ class VeloxFunctionsValidateSuite extends VeloxWholeStageTransformerSuite {
}
}

test("test map_keys function") {
withTempPath {
path =>
Seq(
Map[Int, String](1 -> null, 2 -> "200"),
Map[Int, String](1 -> "100", 2 -> "200", 3 -> "300"),
null
)
.toDF("i")
.write
.parquet(path.getCanonicalPath)

spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("map_tbl")

runQueryAndCompare("select map_keys(i) from map_tbl") {
checkOperatorMatch[ProjectExecTransformer]
}
}
}

test("test map_values function") {
withTempPath {
path =>
Seq(
Map[Int, String](1 -> null, 2 -> "200"),
Map[Int, String](1 -> "100", 2 -> "200", 3 -> "300"),
null
)
.toDF("i")
.write
.parquet(path.getCanonicalPath)

spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("map_tbl")

runQueryAndCompare("select map_values(i) from map_tbl") {
checkOperatorMatch[ProjectExecTransformer]
}
}
}

test("Test isnan function") {
runQueryAndCompare(
"SELECT isnan(l_orderkey), isnan(cast('NaN' as double)), isnan(0.0F/0.0F)" +
Expand Down
4 changes: 2 additions & 2 deletions docs/velox-backend-support-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ Gluten supports 199 functions. (Draw to right to see all data types)
| get_map_value | | element_at | S | | | | | | | | | | | | | | | | | S | | |
| map_from_arrays | | map_from_arrays | S | | | | | | | | | | | | | | | | | S | | |
| map_from_entries | map_from_entries | | | | | | | | | | | | | | | | | | | | | |
| map_keys | map_keys | | | | | | | | | | | | | | | | | | | | | |
| map_values | map_values | | S | | | | | | | | | | | | | | | | | S | | |
| map_keys | map_keys | map_keys | S | | | | | | | | | | | | | | | | | | | |
| map_values | map_values | map_values | S | | | | | | | | | | | | | | | | | S | | |
| named_struct,struct | row_construct | named_struct | S | | | | | | | | | | | | | | | | | | S | |
| posexplode_outer,posexplode | | | | | | | | | | | | | | | | | | | | | | |
| sequence | | | | | | | | | | | | | | | | | | | | | | |
Expand Down
Loading