Skip to content

Commit

Permalink
fix ut (#7485)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinyhZou authored Oct 14, 2024
1 parent 20f2d20 commit cea377d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ class FunctionParserElementAt : public FunctionParser
if (isMap(arg_type))
{
const auto * map_arg = parsed_args[0];
const DataTypeMap * map_type = checkAndGetDataType<DataTypeMap>(removeNullable(map_arg->result_type).get());
if (isNothing(map_type->getKeyType()))
{
const DataTypePtr value_type = map_type->getValueType();
const auto * null_const_node = addColumnToActionsDAG(actions_dag, makeNullable(value_type), Field{});
return null_const_node;
}
const auto * key_arg = parsed_args[1];
const auto * result_node = toFunctionNode(actions_dag, "arrayElementOrNull", {map_arg, key_arg});
return convertNodeTypeIfNeeded(substrait_func, result_node, actions_dag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenDataFrameComplexTypeSuite]
enableSuite[GlutenDataFrameFunctionsSuite]
.exclude("map with arrays")
.exclude("element_at function")
.exclude("flatten function")
.exclude("aggregate function - array for primitive type not containing null")
.exclude("aggregate function - array for primitive type containing null")
Expand Down Expand Up @@ -655,7 +654,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenCollectionExpressionsSuite]
.exclude("ArraysZip") // wait for https://github.com/ClickHouse/ClickHouse/pull/69576
.exclude("Sequence of numbers")
.exclude("elementAt")
.exclude("Shuffle")
.exclude("SPARK-33386: element_at ArrayIndexOutOfBoundsException")
.exclude("SPARK-33460: element_at NoSuchElementException")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenDataFrameComplexTypeSuite]
enableSuite[GlutenDataFrameFunctionsSuite]
.exclude("map with arrays")
.exclude("element_at function")
.exclude("flatten function")
.exclude("aggregate function - array for primitive type not containing null")
.exclude("aggregate function - array for primitive type containing null")
Expand Down Expand Up @@ -683,7 +682,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenCollectionExpressionsSuite]
.exclude("ArraysZip") // wait for https://github.com/ClickHouse/ClickHouse/pull/69576
.exclude("Sequence of numbers")
.exclude("elementAt")
.exclude("Shuffle")
.exclude("SPARK-33386: element_at ArrayIndexOutOfBoundsException")
.exclude("SPARK-33460: element_at NoSuchElementException")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenDataFrameComplexTypeSuite]
enableSuite[GlutenDataFrameFunctionsSuite]
.exclude("map with arrays")
.exclude("element_at function")
.exclude("flatten function")
.exclude("aggregate function - array for primitive type not containing null")
.exclude("aggregate function - array for primitive type containing null")
Expand Down Expand Up @@ -572,7 +571,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenCollectionExpressionsSuite]
.exclude("ArraysZip") // wait for https://github.com/ClickHouse/ClickHouse/pull/69576
.exclude("Sequence of numbers")
.exclude("elementAt")
.exclude("Shuffle")
.exclude("SPARK-33386: element_at ArrayIndexOutOfBoundsException")
.exclude("SPARK-33460: element_at NoSuchElementException")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenDataFrameComplexTypeSuite]
enableSuite[GlutenDataFrameFunctionsSuite]
.exclude("map with arrays")
.exclude("element_at function")
.exclude("flatten function")
.exclude("aggregate function - array for primitive type not containing null")
.exclude("aggregate function - array for primitive type containing null")
Expand Down Expand Up @@ -572,7 +571,6 @@ class ClickHouseTestSettings extends BackendTestSettings {
enableSuite[GlutenCollectionExpressionsSuite]
.exclude("ArraysZip") // wait for https://github.com/ClickHouse/ClickHouse/pull/69576
.exclude("Sequence of numbers")
.exclude("elementAt")
.exclude("Shuffle")
.exclude("SPARK-33386: element_at ArrayIndexOutOfBoundsException")
.exclude("SPARK-33460: element_at NoSuchElementException")
Expand Down

0 comments on commit cea377d

Please sign in to comment.