Skip to content

Commit

Permalink
support null type in hashagg
Browse files Browse the repository at this point in the history
  • Loading branch information
WangGuangxin committed Jan 3, 2025
1 parent b956a72 commit e842468
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1275,14 +1275,12 @@ class MiscOperatorSuite extends VeloxWholeStageTransformerSuite with AdaptiveSpa
|select cast(id as int) as c1, cast(id as string) c2 from range(100) order by c1 desc;
|""".stripMargin)

withSQLConf("spark.gluten.sql.columnar.forceShuffledHashJoin" -> "true") {
runQueryAndCompare(
"""
|select * from t1 cross join t2 on t1.c1 = t2.c1;
|""".stripMargin
) {
checkGlutenOperatorMatch[ShuffledHashJoinExecTransformer]
}
runQueryAndCompare(
"""
|select * from t1 cross join t2 on t1.c1 = t2.c1;
|""".stripMargin
) {
checkGlutenOperatorMatch[ShuffledHashJoinExecTransformer]
}

withSQLConf("spark.sql.autoBroadcastJoinThreshold" -> "1MB") {
Expand Down Expand Up @@ -1985,4 +1983,10 @@ class MiscOperatorSuite extends VeloxWholeStageTransformerSuite with AdaptiveSpa
}
}
}

test("support null type in aggregate") {
runQueryAndCompare("SELECT max(null), min(null) from range(10)".stripMargin) {
checkGlutenOperatorMatch[HashAggregateExecTransformer]
}
}
}
4 changes: 4 additions & 0 deletions cpp/velox/substrait/VeloxSubstraitSignature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ TypePtr VeloxSubstraitSignature::fromSubstraitSignature(const std::string& signa
return DATE();
}

if (signature == "nothing") {
return UNKNOWN();
}

auto startWith = [](const std::string& str, const std::string& prefix) {
return str.size() >= prefix.size() && str.substr(0, prefix.size()) == prefix;
};
Expand Down

0 comments on commit e842468

Please sign in to comment.