Skip to content
Open
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 @@ -427,6 +427,14 @@ class GlutenClickHouseTPCHSuite extends MergeTreeSuite {

}

test("var_samp returns null instead of NaN") {
val sql1 = "select var_samp(id) from range(1)"
val sql2 = "select covar_samp(id, id) from range(1)"

compareResultsAgainstVanillaSpark(sql1, true, { _ => })
compareResultsAgainstVanillaSpark(sql2, true, { _ => })
}

test("existence join") {
spark.sql("create table t1(a int, b int) using parquet")
spark.sql("create table t2(a int, b int) using parquet")
Expand Down
4 changes: 3 additions & 1 deletion cpp-ch/local-engine/Parser/AggregateFunctionParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ const DB::ActionsDAG::Node * AggregateFunctionParser::convertNodeTypeIfNeeded(
const DB::ActionsDAG::Node * AggregateFunctionParser::convertNanToNullIfNeed(
const CommonFunctionInfo & func_info, const DB::ActionsDAG::Node * func_node, DB::ActionsDAG & actions_dag) const
{
if (getCHFunctionName(func_info) != "corr" || !func_node->result_type->isNullable())
const auto function_name = getCHFunctionName(func_info);
if ((function_name != "corr" && function_name != "varSamp" && function_name != "covarSamp")
|| !func_node->result_type->isNullable())
return func_node;

/// result is nullable.
Expand Down
Loading