Skip to content
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 @@ -489,6 +489,20 @@ class GlutenFunctionValidateSuite extends GlutenClickHouseWholeStageTransformerS
runQueryAndCompare(sql1)(checkGlutenPlan[ProjectExecTransformer])
}

test("test str2map with nullable string input") {
val sql =
"""
|select id, str_to_map(str, ',', ':')
|from (
| select id,
| if(id = 1, cast(null as string), concat('k:', cast(id as string))) as str
| from range(4)
|)
|order by id
|""".stripMargin
runQueryAndCompare(sql)(checkGlutenPlan[ProjectExecTransformer])
}

test("test parse_url") {
val sql1 =
"""
Expand Down
2 changes: 1 addition & 1 deletion cpp-ch/local-engine/Functions/SparkFunctionStrToMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class SparkFunctionStrToMap : public DB::IFunction

for (size_t i = 0, n = offsets.size(); i < n; ++i)
{
if (null_map && (*null_map)[n] != 0)
if (null_map && (*null_map)[i] != 0)
col_map->insertDefault();
else
{
Expand Down
Loading