You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by zh...@apache.org on 2024/07/15 01:55:38 UTC
(doris) branch master updated: [fix](function)adjust aggregate function's nullable property (#37330)
This is an automated email from the ASF dual-hosted git repository.
zhangstar333 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 08169691a9f [fix](function)adjust aggregate function's nullable property (#37330)
08169691a9f is described below
commit 08169691a9f68d7667254eaef5a75610b2c92d08
Author: zhangstar333 <87...@users.noreply.github.com>
AuthorDate: Mon Jul 15 09:55:32 2024 +0800
[fix](function)adjust aggregate function's nullable property (#37330)
## Proposed changes
in this PR have change some age function nullable property.
aggregate functions can be divided into 3 types by their nullable
properties:
- AlwaysNullable
- AlwaysNotNullable
- NullableAggregateFunction
this PR code of FE part from https://github.com/apache/doris/pull/37215,
the author is @starocean999
---------
Co-authored-by: starocean999 <12...@qq.com>
---
be/src/agent/be_exec_version_manager.h | 6 +-
be/src/pipeline/exec/aggregation_sink_operator.cpp | 2 +-
be/src/pipeline/exec/analytic_source_operator.cpp | 1 +
.../distinct_streaming_aggregation_operator.cpp | 2 +-
.../exec/streaming_aggregation_operator.cpp | 2 +-
.../aggregate_function_covar.cpp | 25 +-
.../aggregate_functions/aggregate_function_covar.h | 37 +-
.../aggregate_function_percentile.cpp | 82 +-
.../aggregate_function_percentile.h | 116 ++-
.../aggregate_function_stddev.cpp | 53 +-
.../aggregate_function_stddev.h | 37 +-
.../apache/doris/catalog/AggregateFunction.java | 2 +-
.../trees/expressions/functions/agg/AnyValue.java | 20 +-
.../expressions/functions/agg/AvgWeighted.java | 20 +-
.../trees/expressions/functions/agg/Corr.java | 20 +-
.../trees/expressions/functions/agg/Covar.java | 20 +-
.../trees/expressions/functions/agg/CovarSamp.java | 20 +-
.../trees/expressions/functions/agg/Histogram.java | 4 +-
.../trees/expressions/functions/agg/MaxBy.java | 2 +-
.../functions/agg/MultiDistinctSum.java | 2 +-
.../functions/agg/PercentileApprox.java | 35 +-
.../functions/agg/PercentileApproxWeighted.java | 49 +-
.../expressions/functions/agg/PercentileArray.java | 4 +-
.../trees/expressions/functions/agg/Retention.java | 22 +-
.../expressions/functions/agg/SequenceMatch.java | 25 +-
.../expressions/functions/agg/StddevSamp.java | 20 +-
.../trees/expressions/functions/agg/TopN.java | 34 +-
.../trees/expressions/functions/agg/TopNArray.java | 34 +-
.../expressions/functions/agg/TopNWeighted.java | 39 +-
.../expressions/functions/agg/VarianceSamp.java | 20 +-
.../expressions/functions/agg/WindowFunnel.java | 24 +-
.../visitor/AggregateFunctionVisitor.java | 38 +-
.../test_select_stddev_variance_window.out | 84 +-
.../data/function_p0/test_agg_foreach.out | 6 +-
.../data/function_p0/test_agg_foreach_notnull.out | 6 +-
.../inverted_index_p1/tpcds_sf1_index/sql/q17.out | 3 +-
.../data/nereids_function_p0/agg_function/agg.out | 736 +++++++-------
.../data/nereids_p0/aggregate/agg_nullable.out | 433 ++++++++
.../data/nereids_p0/aggregate/agg_nullable_2.out | 478 +++++++++
.../test_select_stddev_variance_window.out | 168 ++--
.../nereids_syntax_p0/mv/aggregate/agg_sync_mv.out | 20 +-
.../test_aggregate_all_functions2.out | 2 +-
.../test_select_stddev_variance_window.out | 168 ++--
regression-test/data/tpcds_sf1_p1/sql/q17.out | 2 +-
.../data/tpcds_sf1_unique_p1/sql/q17.out | 3 +-
.../nereids_p0/aggregate/agg_nullable.groovy | 1024 +++++++++++++++++++
.../nereids_p0/aggregate/agg_nullable_2.groovy | 1036 ++++++++++++++++++++
47 files changed, 4179 insertions(+), 807 deletions(-)
diff --git a/be/src/agent/be_exec_version_manager.h b/be/src/agent/be_exec_version_manager.h
index 8f8b43a2728..ec6ddf497ec 100644
--- a/be/src/agent/be_exec_version_manager.h
+++ b/be/src/agent/be_exec_version_manager.h
@@ -79,13 +79,15 @@ private:
* a. change the impl of percentile (need fix)
* b. clear old version of version 3->4
* c. change FunctionIsIPAddressInRange from AlwaysNotNullable to DependOnArguments
+ * d. change some agg function nullable property: PR #37215
*/
constexpr inline int BeExecVersionManager::max_be_exec_version = 5;
constexpr inline int BeExecVersionManager::min_be_exec_version = 0;
/// functional
constexpr inline int BITMAP_SERDE = 3;
-constexpr inline int USE_NEW_SERDE = 4; // release on DORIS version 2.1
-constexpr inline int OLD_WAL_SERDE = 3; // use to solve compatibility issues, see pr #32299
+constexpr inline int USE_NEW_SERDE = 4; // release on DORIS version 2.1
+constexpr inline int OLD_WAL_SERDE = 3; // use to solve compatibility issues, see pr #32299
+constexpr inline int AGG_FUNCTION_NULLABLE = 5; // change some agg nullable property: PR #37215
} // namespace doris
diff --git a/be/src/pipeline/exec/aggregation_sink_operator.cpp b/be/src/pipeline/exec/aggregation_sink_operator.cpp
index 1dab1669dd5..79ca07281d9 100644
--- a/be/src/pipeline/exec/aggregation_sink_operator.cpp
+++ b/be/src/pipeline/exec/aggregation_sink_operator.cpp
@@ -792,6 +792,7 @@ Status AggSinkOperatorX::prepare(RuntimeState* state) {
RETURN_IF_ERROR(_aggregate_evaluators[i]->prepare(
state, DataSinkOperatorX<AggSinkLocalState>::_child_x->row_desc(),
intermediate_slot_desc, output_slot_desc));
+ _aggregate_evaluators[i]->set_version(state->be_exec_version());
}
_offsets_of_aggregate_states.resize(_aggregate_evaluators.size());
@@ -832,7 +833,6 @@ Status AggSinkOperatorX::open(RuntimeState* state) {
for (auto& _aggregate_evaluator : _aggregate_evaluators) {
RETURN_IF_ERROR(_aggregate_evaluator->open(state));
- _aggregate_evaluator->set_version(state->be_exec_version());
}
return Status::OK();
diff --git a/be/src/pipeline/exec/analytic_source_operator.cpp b/be/src/pipeline/exec/analytic_source_operator.cpp
index bc8f3279f92..a036481d727 100644
--- a/be/src/pipeline/exec/analytic_source_operator.cpp
+++ b/be/src/pipeline/exec/analytic_source_operator.cpp
@@ -572,6 +572,7 @@ Status AnalyticSourceOperatorX::prepare(RuntimeState* state) {
SlotDescriptor* output_slot_desc = _output_tuple_desc->slots()[i];
RETURN_IF_ERROR(_agg_functions[i]->prepare(state, _child_x->row_desc(),
intermediate_slot_desc, output_slot_desc));
+ _agg_functions[i]->set_version(state->be_exec_version());
_change_to_nullable_flags.push_back(output_slot_desc->is_nullable() &&
!_agg_functions[i]->data_type()->is_nullable());
}
diff --git a/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp b/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp
index 4390bebcfdd..e8efb51973e 100644
--- a/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp
+++ b/be/src/pipeline/exec/distinct_streaming_aggregation_operator.cpp
@@ -390,6 +390,7 @@ Status DistinctStreamingAggOperatorX::prepare(RuntimeState* state) {
SlotDescriptor* output_slot_desc = _output_tuple_desc->slots()[j];
RETURN_IF_ERROR(_aggregate_evaluators[i]->prepare(
state, _child_x->row_desc(), intermediate_slot_desc, output_slot_desc));
+ _aggregate_evaluators[i]->set_version(state->be_exec_version());
}
for (size_t i = 0; i < _aggregate_evaluators.size(); ++i) {
@@ -421,7 +422,6 @@ Status DistinctStreamingAggOperatorX::open(RuntimeState* state) {
for (int i = 0; i < _aggregate_evaluators.size(); ++i) {
RETURN_IF_ERROR(_aggregate_evaluators[i]->open(state));
- _aggregate_evaluators[i]->set_version(state->be_exec_version());
}
return Status::OK();
diff --git a/be/src/pipeline/exec/streaming_aggregation_operator.cpp b/be/src/pipeline/exec/streaming_aggregation_operator.cpp
index 85cf8487575..689a361c371 100644
--- a/be/src/pipeline/exec/streaming_aggregation_operator.cpp
+++ b/be/src/pipeline/exec/streaming_aggregation_operator.cpp
@@ -1198,6 +1198,7 @@ Status StreamingAggOperatorX::prepare(RuntimeState* state) {
SlotDescriptor* output_slot_desc = _output_tuple_desc->slots()[j];
RETURN_IF_ERROR(_aggregate_evaluators[i]->prepare(
state, _child_x->row_desc(), intermediate_slot_desc, output_slot_desc));
+ _aggregate_evaluators[i]->set_version(state->be_exec_version());
}
_offsets_of_aggregate_states.resize(_aggregate_evaluators.size());
@@ -1239,7 +1240,6 @@ Status StreamingAggOperatorX::open(RuntimeState* state) {
for (int i = 0; i < _aggregate_evaluators.size(); ++i) {
RETURN_IF_ERROR(_aggregate_evaluators[i]->open(state));
- _aggregate_evaluators[i]->set_version(state->be_exec_version());
}
return Status::OK();
diff --git a/be/src/vec/aggregate_functions/aggregate_function_covar.cpp b/be/src/vec/aggregate_functions/aggregate_function_covar.cpp
index aa5bd511d90..1ff6427f69a 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_covar.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_covar.cpp
@@ -61,12 +61,19 @@ AggregateFunctionPtr create_function_single_value(const String& name,
}
template <bool is_nullable>
+AggregateFunctionPtr create_aggregate_function_covariance_samp_old(const std::string& name,
+ const DataTypes& argument_types,
+ const bool result_is_nullable) {
+ return create_function_single_value<AggregateFunctionSamp_OLDER, CovarSampName, SampData_OLDER,
+ is_nullable>(name, argument_types, result_is_nullable,
+ NULLABLE);
+}
+
AggregateFunctionPtr create_aggregate_function_covariance_samp(const std::string& name,
const DataTypes& argument_types,
const bool result_is_nullable) {
- return create_function_single_value<AggregateFunctionSamp, CovarSampName, SampData,
- is_nullable>(name, argument_types, result_is_nullable,
- NULLABLE);
+ return create_function_single_value<AggregateFunctionSamp, CovarSampName, SampData>(
+ name, argument_types, result_is_nullable, NOTNULLABLE);
}
AggregateFunctionPtr create_aggregate_function_covariance_pop(const std::string& name,
@@ -81,9 +88,15 @@ void register_aggregate_function_covar_pop(AggregateFunctionSimpleFactory& facto
factory.register_alias("covar", "covar_pop");
}
+void register_aggregate_function_covar_samp_old(AggregateFunctionSimpleFactory& factory) {
+ factory.register_alternative_function(
+ "covar_samp", create_aggregate_function_covariance_samp_old<NOTNULLABLE>);
+ factory.register_alternative_function(
+ "covar_samp", create_aggregate_function_covariance_samp_old<NULLABLE>, NULLABLE);
+}
+
void register_aggregate_function_covar_samp(AggregateFunctionSimpleFactory& factory) {
- factory.register_function("covar_samp", create_aggregate_function_covariance_samp<NOTNULLABLE>);
- factory.register_function("covar_samp", create_aggregate_function_covariance_samp<NULLABLE>,
- NULLABLE);
+ factory.register_function_both("covar_samp", create_aggregate_function_covariance_samp);
+ register_aggregate_function_covar_samp_old(factory);
}
} // namespace doris::vectorized
diff --git a/be/src/vec/aggregate_functions/aggregate_function_covar.h b/be/src/vec/aggregate_functions/aggregate_function_covar.h
index c2b5130411b..9dc2d2d5b38 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_covar.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_covar.h
@@ -17,6 +17,7 @@
#pragma once
+#include "agent/be_exec_version_manager.h"
#define POP true
#define NOTPOP false
#define NULLABLE true
@@ -224,7 +225,7 @@ struct PopData : Data {
};
template <typename T, typename Data>
-struct SampData : Data {
+struct SampData_OLDER : Data {
using ColVecResult =
std::conditional_t<IsDecimalNumber<T>, ColumnDecimal<Decimal128V2>, ColumnFloat64>;
void insert_result_into(IColumn& to) const {
@@ -243,6 +244,24 @@ struct SampData : Data {
}
};
+template <typename T, typename Data>
+struct SampData : Data {
+ using ColVecResult =
+ std::conditional_t<IsDecimalNumber<T>, ColumnDecimal<Decimal128V2>, ColumnFloat64>;
+ void insert_result_into(IColumn& to) const {
+ auto& col = assert_cast<ColVecResult&>(to);
+ if (this->count == 1 || this->count == 0) {
+ col.insert_default();
+ } else {
+ if constexpr (IsDecimalNumber<T>) {
+ col.get_data().push_back(this->get_samp_result().value());
+ } else {
+ col.get_data().push_back(this->get_samp_result());
+ }
+ }
+ }
+};
+
template <typename Data>
struct CovarName : Data {
static const char* name() { return "covar"; }
@@ -269,7 +288,11 @@ public:
if constexpr (is_pop) {
return Data::get_return_type();
} else {
- return make_nullable(Data::get_return_type());
+ if (IAggregateFunction::version < AGG_FUNCTION_NULLABLE) {
+ return make_nullable(Data::get_return_type());
+ } else {
+ return Data::get_return_type();
+ }
}
}
@@ -278,7 +301,7 @@ public:
if constexpr (is_pop) {
this->data(place).add(columns[0], columns[1], row_num);
} else {
- if constexpr (is_nullable) {
+ if constexpr (is_nullable) { //this if check could remove with old function
const auto* nullable_column_x = check_and_get_column<ColumnNullable>(columns[0]);
const auto* nullable_column_y = check_and_get_column<ColumnNullable>(columns[1]);
if (!nullable_column_x->is_null_at(row_num) &&
@@ -313,6 +336,14 @@ public:
}
};
+template <typename Data, bool is_nullable>
+class AggregateFunctionSamp_OLDER final
+ : public AggregateFunctionSampCovariance<NOTPOP, Data, is_nullable> {
+public:
+ AggregateFunctionSamp_OLDER(const DataTypes& argument_types_)
+ : AggregateFunctionSampCovariance<NOTPOP, Data, is_nullable>(argument_types_) {}
+};
+
template <typename Data, bool is_nullable>
class AggregateFunctionSamp final
: public AggregateFunctionSampCovariance<NOTPOP, Data, is_nullable> {
diff --git a/be/src/vec/aggregate_functions/aggregate_function_percentile.cpp b/be/src/vec/aggregate_functions/aggregate_function_percentile.cpp
index 75fce934f73..a8767e6fae7 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_percentile.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_percentile.cpp
@@ -24,9 +24,8 @@
namespace doris::vectorized {
template <bool is_nullable>
-AggregateFunctionPtr create_aggregate_function_percentile_approx(const std::string& name,
- const DataTypes& argument_types,
- const bool result_is_nullable) {
+AggregateFunctionPtr create_aggregate_function_percentile_approx_older(
+ const std::string& name, const DataTypes& argument_types, const bool result_is_nullable) {
const DataTypePtr& argument_type = remove_nullable(argument_types[0]);
WhichDataType which(argument_type);
if (which.idx != TypeIndex::Float64) {
@@ -34,19 +33,38 @@ AggregateFunctionPtr create_aggregate_function_percentile_approx(const std::stri
}
if (argument_types.size() == 2) {
return creator_without_type::create<
- AggregateFunctionPercentileApproxTwoParams<is_nullable>>(
- remove_nullable(argument_types), result_is_nullable);
+ AggregateFunctionPercentileApproxTwoParams_OLDER<is_nullable>>((argument_types),
+ result_is_nullable);
}
if (argument_types.size() == 3) {
return creator_without_type::create<
- AggregateFunctionPercentileApproxThreeParams<is_nullable>>(
+ AggregateFunctionPercentileApproxThreeParams_OLDER<is_nullable>>(
remove_nullable(argument_types), result_is_nullable);
}
return nullptr;
}
+AggregateFunctionPtr create_aggregate_function_percentile_approx(const std::string& name,
+ const DataTypes& argument_types,
+ const bool result_is_nullable) {
+ const DataTypePtr& argument_type = remove_nullable(argument_types[0]);
+ WhichDataType which(argument_type);
+ if (which.idx != TypeIndex::Float64) {
+ return nullptr;
+ }
+ if (argument_types.size() == 2) {
+ return creator_without_type::create<AggregateFunctionPercentileApproxTwoParams>(
+ argument_types, result_is_nullable);
+ }
+ if (argument_types.size() == 3) {
+ return creator_without_type::create<AggregateFunctionPercentileApproxThreeParams>(
+ argument_types, result_is_nullable);
+ }
+ return nullptr;
+}
+
template <bool is_nullable>
-AggregateFunctionPtr create_aggregate_function_percentile_approx_weighted(
+AggregateFunctionPtr create_aggregate_function_percentile_approx_weighted_older(
const std::string& name, const DataTypes& argument_types, const bool result_is_nullable) {
const DataTypePtr& argument_type = remove_nullable(argument_types[0]);
WhichDataType which(argument_type);
@@ -55,17 +73,35 @@ AggregateFunctionPtr create_aggregate_function_percentile_approx_weighted(
}
if (argument_types.size() == 3) {
return creator_without_type::create<
- AggregateFunctionPercentileApproxWeightedThreeParams<is_nullable>>(
+ AggregateFunctionPercentileApproxWeightedThreeParams_OLDER<is_nullable>>(
remove_nullable(argument_types), result_is_nullable);
}
if (argument_types.size() == 4) {
return creator_without_type::create<
- AggregateFunctionPercentileApproxWeightedFourParams<is_nullable>>(
+ AggregateFunctionPercentileApproxWeightedFourParams_OLDER<is_nullable>>(
remove_nullable(argument_types), result_is_nullable);
}
return nullptr;
}
+AggregateFunctionPtr create_aggregate_function_percentile_approx_weighted(
+ const std::string& name, const DataTypes& argument_types, const bool result_is_nullable) {
+ const DataTypePtr& argument_type = remove_nullable(argument_types[0]);
+ WhichDataType which(argument_type);
+ if (which.idx != TypeIndex::Float64) {
+ return nullptr;
+ }
+ if (argument_types.size() == 3) {
+ return creator_without_type::create<AggregateFunctionPercentileApproxWeightedThreeParams>(
+ argument_types, result_is_nullable);
+ }
+ if (argument_types.size() == 4) {
+ return creator_without_type::create<AggregateFunctionPercentileApproxWeightedFourParams>(
+ argument_types, result_is_nullable);
+ }
+ return nullptr;
+}
+
void register_aggregate_function_percentile(AggregateFunctionSimpleFactory& factory) {
factory.register_function_both("percentile",
creator_with_integer_type::creator<AggregateFunctionPercentile>);
@@ -74,14 +110,26 @@ void register_aggregate_function_percentile(AggregateFunctionSimpleFactory& fact
creator_with_integer_type::creator<AggregateFunctionPercentileArray>);
}
+void register_percentile_approx_old_function(AggregateFunctionSimpleFactory& factory) {
+ factory.register_alternative_function(
+ "percentile_approx", create_aggregate_function_percentile_approx_older<false>, false);
+ factory.register_alternative_function(
+ "percentile_approx", create_aggregate_function_percentile_approx_older<true>, true);
+ factory.register_alternative_function(
+ "percentile_approx_weighted",
+ create_aggregate_function_percentile_approx_weighted_older<false>, false);
+ factory.register_alternative_function(
+ "percentile_approx_weighted",
+ create_aggregate_function_percentile_approx_weighted_older<true>, true);
+}
+
void register_aggregate_function_percentile_approx(AggregateFunctionSimpleFactory& factory) {
- factory.register_function("percentile_approx",
- create_aggregate_function_percentile_approx<false>, false);
- factory.register_function("percentile_approx",
- create_aggregate_function_percentile_approx<true>, true);
- factory.register_function("percentile_approx_weighted",
- create_aggregate_function_percentile_approx_weighted<false>, false);
- factory.register_function("percentile_approx_weighted",
- create_aggregate_function_percentile_approx_weighted<true>, true);
+ factory.register_function_both("percentile_approx",
+ create_aggregate_function_percentile_approx);
+ factory.register_function_both("percentile_approx_weighted",
+ create_aggregate_function_percentile_approx_weighted);
+
+ register_percentile_approx_old_function(factory);
}
+
} // namespace doris::vectorized
\ No newline at end of file
diff --git a/be/src/vec/aggregate_functions/aggregate_function_percentile.h b/be/src/vec/aggregate_functions/aggregate_function_percentile.h
index c6b4515a804..3f83744f13e 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_percentile.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_percentile.h
@@ -29,6 +29,7 @@
#include <string>
#include <vector>
+#include "agent/be_exec_version_manager.h"
#include "util/counts.h"
#include "util/tdigest.h"
#include "vec/aggregate_functions/aggregate_function.h"
@@ -158,7 +159,10 @@ public:
String get_name() const override { return "percentile_approx"; }
DataTypePtr get_return_type() const override {
- return make_nullable(std::make_shared<DataTypeFloat64>());
+ if (IAggregateFunction::version < AGG_FUNCTION_NULLABLE) {
+ return make_nullable(std::make_shared<DataTypeFloat64>());
+ }
+ return std::make_shared<DataTypeFloat64>();
}
void reset(AggregateDataPtr __restrict place) const override {
@@ -181,23 +185,34 @@ public:
}
void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
- ColumnNullable& nullable_column = assert_cast<ColumnNullable&>(to);
- double result = AggregateFunctionPercentileApprox::data(place).get();
-
- if (std::isnan(result)) {
- nullable_column.insert_default();
+ if (IAggregateFunction::version < AGG_FUNCTION_NULLABLE) {
+ ColumnNullable& nullable_column = assert_cast<ColumnNullable&>(to);
+ double result = AggregateFunctionPercentileApprox::data(place).get();
+
+ if (std::isnan(result)) {
+ nullable_column.insert_default();
+ } else {
+ auto& col = assert_cast<ColumnFloat64&>(nullable_column.get_nested_column());
+ col.get_data().push_back(result);
+ nullable_column.get_null_map_data().push_back(0);
+ }
} else {
- auto& col = assert_cast<ColumnFloat64&>(nullable_column.get_nested_column());
- col.get_data().push_back(result);
- nullable_column.get_null_map_data().push_back(0);
+ auto& col = assert_cast<ColumnFloat64&>(to);
+ double result = AggregateFunctionPercentileApprox::data(place).get();
+
+ if (std::isnan(result)) {
+ col.insert_default();
+ } else {
+ col.get_data().push_back(result);
+ }
}
}
};
template <bool is_nullable>
-class AggregateFunctionPercentileApproxTwoParams : public AggregateFunctionPercentileApprox {
+class AggregateFunctionPercentileApproxTwoParams_OLDER : public AggregateFunctionPercentileApprox {
public:
- AggregateFunctionPercentileApproxTwoParams(const DataTypes& argument_types_)
+ AggregateFunctionPercentileApproxTwoParams_OLDER(const DataTypes& argument_types_)
: AggregateFunctionPercentileApprox(argument_types_) {}
void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
Arena*) const override {
@@ -234,10 +249,24 @@ public:
}
};
+class AggregateFunctionPercentileApproxTwoParams : public AggregateFunctionPercentileApprox {
+public:
+ AggregateFunctionPercentileApproxTwoParams(const DataTypes& argument_types_)
+ : AggregateFunctionPercentileApprox(argument_types_) {}
+ void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
+ Arena*) const override {
+ const auto& sources = assert_cast<const ColumnFloat64&>(*columns[0]);
+ const auto& quantile = assert_cast<const ColumnFloat64&>(*columns[1]);
+ this->data(place).init();
+ this->data(place).add(sources.get_element(row_num), quantile.get_element(row_num));
+ }
+};
+
template <bool is_nullable>
-class AggregateFunctionPercentileApproxThreeParams : public AggregateFunctionPercentileApprox {
+class AggregateFunctionPercentileApproxThreeParams_OLDER
+ : public AggregateFunctionPercentileApprox {
public:
- AggregateFunctionPercentileApproxThreeParams(const DataTypes& argument_types_)
+ AggregateFunctionPercentileApproxThreeParams_OLDER(const DataTypes& argument_types_)
: AggregateFunctionPercentileApprox(argument_types_) {}
void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
Arena*) const override {
@@ -275,11 +304,26 @@ public:
}
};
+class AggregateFunctionPercentileApproxThreeParams : public AggregateFunctionPercentileApprox {
+public:
+ AggregateFunctionPercentileApproxThreeParams(const DataTypes& argument_types_)
+ : AggregateFunctionPercentileApprox(argument_types_) {}
+ void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
+ Arena*) const override {
+ const auto& sources = assert_cast<const ColumnFloat64&>(*columns[0]);
+ const auto& quantile = assert_cast<const ColumnFloat64&>(*columns[1]);
+ const auto& compression = assert_cast<const ColumnFloat64&>(*columns[2]);
+
+ this->data(place).init(compression.get_element(row_num));
+ this->data(place).add(sources.get_element(row_num), quantile.get_element(row_num));
+ }
+};
+
template <bool is_nullable>
-class AggregateFunctionPercentileApproxWeightedThreeParams
+class AggregateFunctionPercentileApproxWeightedThreeParams_OLDER
: public AggregateFunctionPercentileApprox {
public:
- AggregateFunctionPercentileApproxWeightedThreeParams(const DataTypes& argument_types_)
+ AggregateFunctionPercentileApproxWeightedThreeParams_OLDER(const DataTypes& argument_types_)
: AggregateFunctionPercentileApprox(argument_types_) {}
void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
@@ -319,11 +363,29 @@ public:
}
};
+class AggregateFunctionPercentileApproxWeightedThreeParams
+ : public AggregateFunctionPercentileApprox {
+public:
+ AggregateFunctionPercentileApproxWeightedThreeParams(const DataTypes& argument_types_)
+ : AggregateFunctionPercentileApprox(argument_types_) {}
+
+ void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
+ Arena*) const override {
+ const auto& sources = assert_cast<const ColumnVector<Float64>&>(*columns[0]);
+ const auto& weight = assert_cast<const ColumnVector<Float64>&>(*columns[1]);
+ const auto& quantile = assert_cast<const ColumnVector<Float64>&>(*columns[2]);
+
+ this->data(place).init();
+ this->data(place).add_with_weight(sources.get_element(row_num), weight.get_element(row_num),
+ quantile.get_element(row_num));
+ }
+};
+
template <bool is_nullable>
-class AggregateFunctionPercentileApproxWeightedFourParams
+class AggregateFunctionPercentileApproxWeightedFourParams_OLDER
: public AggregateFunctionPercentileApprox {
public:
- AggregateFunctionPercentileApproxWeightedFourParams(const DataTypes& argument_types_)
+ AggregateFunctionPercentileApproxWeightedFourParams_OLDER(const DataTypes& argument_types_)
: AggregateFunctionPercentileApprox(argument_types_) {}
void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
Arena*) const override {
@@ -364,10 +426,28 @@ public:
}
};
+class AggregateFunctionPercentileApproxWeightedFourParams
+ : public AggregateFunctionPercentileApprox {
+public:
+ AggregateFunctionPercentileApproxWeightedFourParams(const DataTypes& argument_types_)
+ : AggregateFunctionPercentileApprox(argument_types_) {}
+ void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
+ Arena*) const override {
+ const auto& sources = assert_cast<const ColumnVector<Float64>&>(*columns[0]);
+ const auto& weight = assert_cast<const ColumnVector<Float64>&>(*columns[1]);
+ const auto& quantile = assert_cast<const ColumnVector<Float64>&>(*columns[2]);
+ const auto& compression = assert_cast<const ColumnVector<Float64>&>(*columns[3]);
+
+ this->data(place).init(compression.get_element(row_num));
+ this->data(place).add_with_weight(sources.get_element(row_num), weight.get_element(row_num),
+ quantile.get_element(row_num));
+ }
+};
+
template <typename T>
struct PercentileState {
mutable std::vector<Counts<T>> vec_counts;
- std::vector<double> vec_quantile {-1};
+ std::vector<double> vec_quantile;
bool inited_flag = false;
void write(BufferWritable& buf) const {
diff --git a/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp b/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp
index 2c4fa002d55..ed13e0f5ea0 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_stddev.cpp
@@ -61,21 +61,28 @@ AggregateFunctionPtr create_function_single_value(const String& name,
}
template <bool is_stddev, bool is_nullable>
+AggregateFunctionPtr create_aggregate_function_variance_samp_older(const std::string& name,
+ const DataTypes& argument_types,
+ const bool result_is_nullable) {
+ return create_function_single_value<AggregateFunctionSamp_OLDER, VarianceSampName,
+ SampData_OLDER, is_stddev, is_nullable>(
+ name, argument_types, result_is_nullable, true);
+}
+
AggregateFunctionPtr create_aggregate_function_variance_samp(const std::string& name,
const DataTypes& argument_types,
const bool result_is_nullable) {
- return create_function_single_value<AggregateFunctionSamp, VarianceSampName, SampData,
- is_stddev, is_nullable>(name, argument_types,
- result_is_nullable, true);
+ return create_function_single_value<AggregateFunctionSamp, VarianceSampName, SampData, false>(
+ name, argument_types, result_is_nullable, false);
}
template <bool is_stddev, bool is_nullable>
-AggregateFunctionPtr create_aggregate_function_stddev_samp(const std::string& name,
- const DataTypes& argument_types,
- const bool result_is_nullable) {
- return create_function_single_value<AggregateFunctionSamp, StddevSampName, SampData, is_stddev,
- is_nullable>(name, argument_types, result_is_nullable,
- true);
+AggregateFunctionPtr create_aggregate_function_stddev_samp_older(const std::string& name,
+ const DataTypes& argument_types,
+ const bool result_is_nullable) {
+ return create_function_single_value<AggregateFunctionSamp_OLDER, StddevSampName, SampData_OLDER,
+ is_stddev, is_nullable>(name, argument_types,
+ result_is_nullable, true);
}
template <bool is_stddev>
@@ -94,6 +101,13 @@ AggregateFunctionPtr create_aggregate_function_stddev_pop(const std::string& nam
name, argument_types, result_is_nullable, false);
}
+AggregateFunctionPtr create_aggregate_function_stddev_samp(const std::string& name,
+ const DataTypes& argument_types,
+ const bool result_is_nullable) {
+ return create_function_single_value<AggregateFunctionSamp, StddevSampName, SampData, true>(
+ name, argument_types, result_is_nullable, false);
+}
+
void register_aggregate_function_stddev_variance_pop(AggregateFunctionSimpleFactory& factory) {
factory.register_function_both("variance", create_aggregate_function_variance_pop<false>);
factory.register_alias("variance", "var_pop");
@@ -102,14 +116,21 @@ void register_aggregate_function_stddev_variance_pop(AggregateFunctionSimpleFact
factory.register_alias("stddev", "stddev_pop");
}
+void register_aggregate_function_stddev_variance_samp_old(AggregateFunctionSimpleFactory& factory) {
+ factory.register_alternative_function(
+ "variance_samp", create_aggregate_function_variance_samp_older<false, false>);
+ factory.register_alternative_function(
+ "variance_samp", create_aggregate_function_variance_samp_older<false, true>, true);
+ factory.register_alternative_function("stddev_samp",
+ create_aggregate_function_stddev_samp_older<true, false>);
+ factory.register_alternative_function(
+ "stddev_samp", create_aggregate_function_stddev_samp_older<true, true>, true);
+}
+
void register_aggregate_function_stddev_variance_samp(AggregateFunctionSimpleFactory& factory) {
- factory.register_function("variance_samp",
- create_aggregate_function_variance_samp<false, false>);
- factory.register_function("variance_samp", create_aggregate_function_variance_samp<false, true>,
- true);
+ factory.register_function_both("variance_samp", create_aggregate_function_variance_samp);
factory.register_alias("variance_samp", "var_samp");
- factory.register_function("stddev_samp", create_aggregate_function_stddev_samp<true, false>);
- factory.register_function("stddev_samp", create_aggregate_function_stddev_samp<true, true>,
- true);
+ factory.register_function_both("stddev_samp", create_aggregate_function_stddev_samp);
+ register_aggregate_function_stddev_variance_samp_old(factory);
}
} // namespace doris::vectorized
diff --git a/be/src/vec/aggregate_functions/aggregate_function_stddev.h b/be/src/vec/aggregate_functions/aggregate_function_stddev.h
index d5150b7bca5..ee6e98f341f 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_stddev.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_stddev.h
@@ -26,6 +26,7 @@
#include <memory>
#include <type_traits>
+#include "agent/be_exec_version_manager.h"
#include "olap/olap_common.h"
#include "runtime/decimalv2_value.h"
#include "vec/aggregate_functions/aggregate_function.h"
@@ -257,7 +258,7 @@ struct StddevSampName : Data {
};
template <typename T, typename Data>
-struct SampData : Data {
+struct SampData_OLDER : Data {
using ColVecResult =
std::conditional_t<IsDecimalNumber<T>, ColumnDecimal<Decimal128V2>, ColumnFloat64>;
void insert_result_into(IColumn& to) const {
@@ -276,6 +277,24 @@ struct SampData : Data {
}
};
+template <typename T, typename Data>
+struct SampData : Data {
+ using ColVecResult =
+ std::conditional_t<IsDecimalNumber<T>, ColumnDecimal<Decimal128V2>, ColumnFloat64>;
+ void insert_result_into(IColumn& to) const {
+ auto& col = assert_cast<ColVecResult&>(to);
+ if (this->count == 1 || this->count == 0) {
+ col.insert_default();
+ } else {
+ if constexpr (IsDecimalNumber<T>) {
+ col.get_data().push_back(this->get_samp_result().value());
+ } else {
+ col.get_data().push_back(this->get_samp_result());
+ }
+ }
+ }
+};
+
template <bool is_pop, typename Data, bool is_nullable>
class AggregateFunctionSampVariance
: public IAggregateFunctionDataHelper<
@@ -292,7 +311,11 @@ public:
if constexpr (is_pop) {
return Data::get_return_type();
} else {
- return make_nullable(Data::get_return_type());
+ if (IAggregateFunction::version < AGG_FUNCTION_NULLABLE) {
+ return make_nullable(Data::get_return_type());
+ } else {
+ return Data::get_return_type();
+ }
}
}
@@ -301,7 +324,7 @@ public:
if constexpr (is_pop) {
this->data(place).add(columns[0], row_num);
} else {
- if constexpr (is_nullable) {
+ if constexpr (is_nullable) { //this if check could remove with old function
const auto* nullable_column = check_and_get_column<ColumnNullable>(columns[0]);
if (!nullable_column->is_null_at(row_num)) {
this->data(place).add(&nullable_column->get_nested_column(), row_num);
@@ -335,6 +358,14 @@ public:
//samp function it's always nullables, it's need to handle nullable column
//so return type and add function should processing null values
+template <typename Data, bool is_nullable>
+class AggregateFunctionSamp_OLDER final
+ : public AggregateFunctionSampVariance<false, Data, is_nullable> {
+public:
+ AggregateFunctionSamp_OLDER(const DataTypes& argument_types_)
+ : AggregateFunctionSampVariance<false, Data, is_nullable>(argument_types_) {}
+};
+
template <typename Data, bool is_nullable>
class AggregateFunctionSamp final : public AggregateFunctionSampVariance<false, Data, is_nullable> {
public:
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/AggregateFunction.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/AggregateFunction.java
index 8fb3daceb5f..2786dc6470e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/AggregateFunction.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/AggregateFunction.java
@@ -53,7 +53,7 @@ public class AggregateFunction extends Function {
FunctionSet.ORTHOGONAL_BITMAP_EXPR_CALCULATE_COUNT, FunctionSet.ORTHOGONAL_BITMAP_EXPR_CALCULATE,
FunctionSet.INTERSECT_COUNT, FunctionSet.ORTHOGONAL_BITMAP_UNION_COUNT, FunctionSet.COUNT,
"approx_count_distinct", "ndv", FunctionSet.BITMAP_UNION_INT, FunctionSet.BITMAP_UNION_COUNT,
- "ndv_no_finalize", FunctionSet.WINDOW_FUNNEL, FunctionSet.RETENTION, FunctionSet.SEQUENCE_MATCH,
+ "ndv_no_finalize", "percentile_array", "histogram",
FunctionSet.SEQUENCE_COUNT, FunctionSet.MAP_AGG, FunctionSet.BITMAP_AGG, FunctionSet.ARRAY_AGG,
FunctionSet.COLLECT_LIST, FunctionSet.COLLECT_SET, FunctionSet.GROUP_ARRAY_INTERSECT,
FunctionSet.SUM0, FunctionSet.MULTI_DISTINCT_SUM0);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AnyValue.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AnyValue.java
index c2c0d43660b..50cdacc132b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AnyValue.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AnyValue.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.coercion.AnyDataType;
@@ -33,8 +32,8 @@ import java.util.List;
/**
* AggregateFunction 'any_value'. This class is generated by GenerateFunction.
*/
-public class AnyValue extends AggregateFunction
- implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable {
+public class AnyValue extends NullableAggregateFunction
+ implements UnaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.retArgType(0).args(AnyDataType.INSTANCE_WITHOUT_INDEX)
@@ -44,14 +43,18 @@ public class AnyValue extends AggregateFunction
* constructor with 1 argument.
*/
public AnyValue(Expression arg) {
- super("any_value", arg);
+ this(false, arg);
}
/**
* constructor with 1 argument.
*/
public AnyValue(boolean distinct, Expression arg) {
- super("any_value", false, arg);
+ this(distinct, false, arg);
+ }
+
+ public AnyValue(boolean distinct, boolean alwaysNullable, Expression arg) {
+ super("any_value", distinct, alwaysNullable, arg);
}
/**
@@ -60,7 +63,12 @@ public class AnyValue extends AggregateFunction
@Override
public AnyValue withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 1);
- return new AnyValue(distinct, children.get(0));
+ return new AnyValue(distinct, alwaysNullable, children.get(0));
+ }
+
+ @Override
+ public AnyValue withAlwaysNullable(boolean alwaysNullable) {
+ return new AnyValue(distinct, alwaysNullable, children.get(0));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AvgWeighted.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AvgWeighted.java
index e2054878d9c..82127810135 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AvgWeighted.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AvgWeighted.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.shape.BinaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.BigIntType;
@@ -39,8 +38,8 @@ import java.util.List;
/**
* AggregateFunction 'avg_weighted'. This class is generated by GenerateFunction.
*/
-public class AvgWeighted extends AggregateFunction
- implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullable {
+public class AvgWeighted extends NullableAggregateFunction
+ implements BinaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, DoubleType.INSTANCE),
@@ -56,14 +55,18 @@ public class AvgWeighted extends AggregateFunction
* constructor with 2 arguments.
*/
public AvgWeighted(Expression arg0, Expression arg1) {
- super("avg_weighted", arg0, arg1);
+ this(false, arg0, arg1);
}
/**
* constructor with 2 arguments.
*/
public AvgWeighted(boolean distinct, Expression arg0, Expression arg1) {
- super("avg_weighted", distinct, arg0, arg1);
+ this(distinct, false, arg0, arg1);
+ }
+
+ public AvgWeighted(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1) {
+ super("avg_weighted", distinct, alwaysNullable, arg0, arg1);
}
/**
@@ -72,7 +75,12 @@ public class AvgWeighted extends AggregateFunction
@Override
public AvgWeighted withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 2);
- return new AvgWeighted(distinct, children.get(0), children.get(1));
+ return new AvgWeighted(distinct, alwaysNullable, children.get(0), children.get(1));
+ }
+
+ @Override
+ public AvgWeighted withAlwaysNullable(boolean alwaysNullable) {
+ return new AvgWeighted(distinct, alwaysNullable, children.get(0), children.get(1));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Corr.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Corr.java
index 26f8a720c26..c8f54e2e88f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Corr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Corr.java
@@ -19,7 +19,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -38,8 +37,8 @@ import java.util.List;
/**
* AggregateFunction 'corr'. This class is generated by GenerateFunction.
*/
-public class Corr extends AggregateFunction
- implements UnaryExpression, ExplicitlyCastableSignature, AlwaysNullable {
+public class Corr extends NullableAggregateFunction
+ implements UnaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(DoubleType.INSTANCE).args(TinyIntType.INSTANCE, TinyIntType.INSTANCE),
@@ -54,14 +53,18 @@ public class Corr extends AggregateFunction
* constructor with 2 argument.
*/
public Corr(Expression arg1, Expression arg2) {
- super("corr", arg1, arg2);
+ this(false, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public Corr(boolean distinct, Expression arg1, Expression arg2) {
- super("corr", distinct, arg1, arg2);
+ this(distinct, false, arg1, arg2);
+ }
+
+ public Corr(boolean distinct, boolean alwaysNullable, Expression arg1, Expression arg2) {
+ super("corr", distinct, alwaysNullable, arg1, arg2);
}
/**
@@ -70,7 +73,12 @@ public class Corr extends AggregateFunction
@Override
public Corr withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 2);
- return new Corr(distinct, children.get(0), children.get(1));
+ return new Corr(distinct, alwaysNullable, children.get(0), children.get(1));
+ }
+
+ @Override
+ public Corr withAlwaysNullable(boolean alwaysNullable) {
+ return new Corr(distinct, alwaysNullable, children.get(0), children.get(1));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Covar.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Covar.java
index 12096f547c8..53cb4f579a1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Covar.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Covar.java
@@ -19,7 +19,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -38,8 +37,8 @@ import java.util.List;
/**
* AggregateFunction 'covar'. This class is generated by GenerateFunction.
*/
-public class Covar extends AggregateFunction
- implements UnaryExpression, ExplicitlyCastableSignature, AlwaysNullable {
+public class Covar extends NullableAggregateFunction
+ implements UnaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(DoubleType.INSTANCE).args(TinyIntType.INSTANCE, TinyIntType.INSTANCE),
@@ -54,14 +53,18 @@ public class Covar extends AggregateFunction
* constructor with 2 argument.
*/
public Covar(Expression arg1, Expression arg2) {
- super("covar", arg1, arg2);
+ this(false, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public Covar(boolean distinct, Expression arg1, Expression arg2) {
- super("covar", distinct, arg1, arg2);
+ this(distinct, false, arg1, arg2);
+ }
+
+ public Covar(boolean distinct, boolean alwaysNullable, Expression arg1, Expression arg2) {
+ super("covar", distinct, alwaysNullable, arg1, arg2);
}
/**
@@ -70,7 +73,12 @@ public class Covar extends AggregateFunction
@Override
public Covar withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 2);
- return new Covar(distinct, children.get(0), children.get(1));
+ return new Covar(distinct, alwaysNullable, children.get(0), children.get(1));
+ }
+
+ @Override
+ public Covar withAlwaysNullable(boolean alwaysNullable) {
+ return new Covar(distinct, alwaysNullable, children.get(0), children.get(1));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/CovarSamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/CovarSamp.java
index 310ce2ca211..9dbf4c20b50 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/CovarSamp.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/CovarSamp.java
@@ -19,7 +19,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -38,8 +37,8 @@ import java.util.List;
/**
* AggregateFunction 'covar_samp'. This class is generated by GenerateFunction.
*/
-public class CovarSamp extends AggregateFunction
- implements UnaryExpression, ExplicitlyCastableSignature, AlwaysNullable {
+public class CovarSamp extends NullableAggregateFunction
+ implements UnaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(DoubleType.INSTANCE).args(TinyIntType.INSTANCE, TinyIntType.INSTANCE),
@@ -54,14 +53,18 @@ public class CovarSamp extends AggregateFunction
* constructor with 2 argument.
*/
public CovarSamp(Expression arg1, Expression arg2) {
- super("covar_samp", arg1, arg2);
+ this(false, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public CovarSamp(boolean distinct, Expression arg1, Expression arg2) {
- super("covar_samp", distinct, arg1, arg2);
+ this(distinct, false, arg1, arg2);
+ }
+
+ public CovarSamp(boolean distinct, boolean alwaysNullable, Expression arg1, Expression arg2) {
+ super("covar_samp", distinct, alwaysNullable, arg1, arg2);
}
/**
@@ -70,7 +73,12 @@ public class CovarSamp extends AggregateFunction
@Override
public CovarSamp withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 2);
- return new CovarSamp(distinct, children.get(0), children.get(1));
+ return new CovarSamp(distinct, alwaysNullable, children.get(0), children.get(1));
+ }
+
+ @Override
+ public CovarSamp withAlwaysNullable(boolean alwaysNullable) {
+ return new CovarSamp(distinct, alwaysNullable, children.get(0), children.get(1));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Histogram.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Histogram.java
index 7dbf0874750..1f0c2d60f15 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Histogram.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Histogram.java
@@ -19,8 +19,8 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.functions.SearchSignature;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.DoubleType;
@@ -37,7 +37,7 @@ import java.util.List;
* AggregateFunction 'histogram'. This class is generated by GenerateFunction.
*/
public class Histogram extends AggregateFunction
- implements ExplicitlyCastableSignature, PropagateNullable {
+ implements ExplicitlyCastableSignature, AlwaysNotNullable {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MaxBy.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MaxBy.java
index 17243e5d414..fd5dae4a49c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MaxBy.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MaxBy.java
@@ -56,7 +56,7 @@ public class MaxBy extends NullableAggregateFunction
}
private MaxBy(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1) {
- super("max_by", false, false, arg0, arg1);
+ super("max_by", false, alwaysNullable, arg0, arg1);
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MultiDistinctSum.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MultiDistinctSum.java
index 212140fed93..7fd13753a49 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MultiDistinctSum.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/MultiDistinctSum.java
@@ -80,7 +80,7 @@ public class MultiDistinctSum extends NullableAggregateFunction implements Unary
@Override
public MultiDistinctSum withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 1);
- return new MultiDistinctSum(distinct, children.get(0));
+ return new MultiDistinctSum(distinct, alwaysNullable, children.get(0));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApprox.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApprox.java
index 04af54d6377..e4d7dc66c84 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApprox.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApprox.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.DoubleType;
@@ -33,8 +32,8 @@ import java.util.List;
/**
* AggregateFunction 'percentile_approx'. This class is generated by GenerateFunction.
*/
-public class PercentileApprox extends AggregateFunction
- implements ExplicitlyCastableSignature, AlwaysNullable {
+public class PercentileApprox extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE, DoubleType.INSTANCE),
@@ -46,28 +45,37 @@ public class PercentileApprox extends AggregateFunction
* constructor with 2 arguments.
*/
public PercentileApprox(Expression arg0, Expression arg1) {
- super("percentile_approx", arg0, arg1);
+ this(false, arg0, arg1);
}
/**
* constructor with 2 arguments.
*/
public PercentileApprox(boolean distinct, Expression arg0, Expression arg1) {
- super("percentile_approx", distinct, arg0, arg1);
+ this(distinct, false, arg0, arg1);
+ }
+
+ public PercentileApprox(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1) {
+ super("percentile_approx", distinct, alwaysNullable, arg0, arg1);
}
/**
* constructor with 3 arguments.
*/
public PercentileApprox(Expression arg0, Expression arg1, Expression arg2) {
- super("percentile_approx", arg0, arg1, arg2);
+ this(false, arg0, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public PercentileApprox(boolean distinct, Expression arg0, Expression arg1, Expression arg2) {
- super("percentile_approx", distinct, arg0, arg1, arg2);
+ this(distinct, false, arg0, arg1, arg2);
+ }
+
+ public PercentileApprox(boolean distinct, boolean alwaysNullable, Expression arg0,
+ Expression arg1, Expression arg2) {
+ super("percentile_approx", distinct, alwaysNullable, arg0, arg1, arg2);
}
@Override
@@ -92,9 +100,18 @@ public class PercentileApprox extends AggregateFunction
Preconditions.checkArgument(children.size() == 2
|| children.size() == 3);
if (children.size() == 2) {
- return new PercentileApprox(distinct, children.get(0), children.get(1));
+ return new PercentileApprox(distinct, alwaysNullable, children.get(0), children.get(1));
+ } else {
+ return new PercentileApprox(distinct, alwaysNullable, children.get(0), children.get(1), children.get(2));
+ }
+ }
+
+ @Override
+ public PercentileApprox withAlwaysNullable(boolean alwaysNullable) {
+ if (children.size() == 2) {
+ return new PercentileApprox(distinct, alwaysNullable, children.get(0), children.get(1));
} else {
- return new PercentileApprox(distinct, children.get(0), children.get(1), children.get(2));
+ return new PercentileApprox(distinct, alwaysNullable, children.get(0), children.get(1), children.get(2));
}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApproxWeighted.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApproxWeighted.java
index c0698014641..8698ee8af15 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApproxWeighted.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileApproxWeighted.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.DoubleType;
@@ -33,8 +32,8 @@ import java.util.List;
/**
* AggregateFunction 'percentile_approx_weighted'.
*/
-public class PercentileApproxWeighted extends AggregateFunction
- implements ExplicitlyCastableSignature, AlwaysNullable {
+public class PercentileApproxWeighted extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
@@ -48,29 +47,39 @@ public class PercentileApproxWeighted extends AggregateFunction
* constructor with 3 arguments.
*/
public PercentileApproxWeighted(Expression arg0, Expression arg1, Expression arg2) {
- super("percentile_approx_weighted", arg0, arg1, arg2);
+ this(false, arg0, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public PercentileApproxWeighted(boolean distinct, Expression arg0, Expression arg1, Expression arg2) {
- super("percentile_approx_weighted", distinct, arg0, arg1, arg2);
+ this(distinct, false, arg0, arg1, arg2);
+ }
+
+ public PercentileApproxWeighted(boolean distinct, boolean alwaysNullable, Expression arg0,
+ Expression arg1, Expression arg2) {
+ super("percentile_approx_weighted", distinct, alwaysNullable, arg0, arg1, arg2);
}
/**
* constructor with 4 arguments.
*/
public PercentileApproxWeighted(Expression arg0, Expression arg1, Expression arg2, Expression arg3) {
- super("percentile_approx_weighted", arg0, arg1, arg2, arg3);
+ this(false, arg0, arg1, arg2, arg3);
}
/**
- * constructor with 5 arguments.
+ * constructor with 4 arguments.
*/
public PercentileApproxWeighted(boolean distinct, Expression arg0, Expression arg1, Expression arg2,
Expression arg3) {
- super("percentile_approx_weighted", distinct, arg0, arg1, arg2, arg3);
+ this(distinct, false, arg0, arg1, arg2, arg3);
+ }
+
+ public PercentileApproxWeighted(boolean distinct, boolean alwaysNullable, Expression arg0,
+ Expression arg1, Expression arg2, Expression arg3) {
+ super("percentile_approx_weighted", distinct, alwaysNullable, arg0, arg1, arg2, arg3);
}
@Override
@@ -92,14 +101,26 @@ public class PercentileApproxWeighted extends AggregateFunction
* withDistinctAndChildren.
*/
@Override
- public PercentileApproxWeighted withDistinctAndChildren(boolean distinct, List<Expression> children) {
- Preconditions.checkArgument(children.size() == 3
- || children.size() == 4);
+ public PercentileApproxWeighted withDistinctAndChildren(boolean distinct,
+ List<Expression> children) {
+ Preconditions.checkArgument(children.size() == 3 || children.size() == 4);
+ if (children.size() == 3) {
+ return new PercentileApproxWeighted(distinct, alwaysNullable, children.get(0),
+ children.get(1), children.get(2));
+ } else {
+ return new PercentileApproxWeighted(distinct, alwaysNullable, children.get(0),
+ children.get(1), children.get(2), children.get(3));
+ }
+ }
+
+ @Override
+ public PercentileApproxWeighted withAlwaysNullable(boolean alwaysNullable) {
if (children.size() == 3) {
- return new PercentileApproxWeighted(distinct, children.get(0), children.get(1), children.get(2));
+ return new PercentileApproxWeighted(distinct, alwaysNullable, children.get(0),
+ children.get(1), children.get(2));
} else {
- return new PercentileApproxWeighted(distinct, children.get(0), children.get(1), children.get(2),
- children.get(3));
+ return new PercentileApproxWeighted(distinct, alwaysNullable, children.get(0),
+ children.get(1), children.get(2), children.get(3));
}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileArray.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileArray.java
index 61fcaf3b4c4..efc2ef0304f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileArray.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileArray.java
@@ -19,8 +19,8 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.shape.BinaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.ArrayType;
@@ -40,7 +40,7 @@ import java.util.List;
* AggregateFunction 'percentile_array'. This class is generated by GenerateFunction.
*/
public class PercentileArray extends AggregateFunction
- implements BinaryExpression, ExplicitlyCastableSignature, PropagateNullable {
+ implements BinaryExpression, ExplicitlyCastableSignature, AlwaysNotNullable {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(ArrayType.of(DoubleType.INSTANCE))
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Retention.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Retention.java
index ec3d4b9594d..1b2eebc05c2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Retention.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Retention.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.ArrayType;
@@ -35,8 +34,8 @@ import java.util.List;
/**
* AggregateFunction 'retention'. This class is generated by GenerateFunction.
*/
-public class Retention extends AggregateFunction
- implements ExplicitlyCastableSignature, AlwaysNotNullable {
+public class Retention extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(ArrayType.of(BooleanType.INSTANCE)).varArgs(BooleanType.INSTANCE)
@@ -46,15 +45,18 @@ public class Retention extends AggregateFunction
* constructor with 1 or more arguments.
*/
public Retention(Expression arg, Expression... varArgs) {
- super("retention", ExpressionUtils.mergeArguments(arg, varArgs));
+ this(false, arg, varArgs);
}
/**
* constructor with 1 or more arguments.
*/
public Retention(boolean distinct, Expression arg, Expression... varArgs) {
- super("retention", distinct,
- ExpressionUtils.mergeArguments(arg, varArgs));
+ this(distinct, false, arg, varArgs);
+ }
+
+ public Retention(boolean distinct, boolean alwaysNullable, Expression arg, Expression... varArgs) {
+ super("retention", distinct, alwaysNullable, ExpressionUtils.mergeArguments(arg, varArgs));
}
@Override
@@ -77,7 +79,13 @@ public class Retention extends AggregateFunction
@Override
public Retention withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() >= 1);
- return new Retention(distinct, children.get(0),
+ return new Retention(distinct, alwaysNullable, children.get(0),
+ children.subList(1, children.size()).toArray(new Expression[0]));
+ }
+
+ @Override
+ public Retention withAlwaysNullable(boolean alwaysNullable) {
+ return new Retention(distinct, alwaysNullable, children.get(0),
children.subList(1, children.size()).toArray(new Expression[0]));
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java
index 0fd8f8cbb4c..5e792826e80 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/SequenceMatch.java
@@ -19,7 +19,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.BooleanType;
@@ -37,8 +36,8 @@ import java.util.List;
/**
* AggregateFunction 'sequence_match'. This class is generated by GenerateFunction.
*/
-public class SequenceMatch extends AggregateFunction
- implements ExplicitlyCastableSignature, AlwaysNotNullable, SequenceFunction {
+public class SequenceMatch extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature, SequenceFunction {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BooleanType.INSTANCE)
@@ -53,15 +52,19 @@ public class SequenceMatch extends AggregateFunction
* constructor with 3 or more arguments.
*/
public SequenceMatch(Expression arg0, Expression arg1, Expression arg2, Expression... varArgs) {
- super("sequence_match", ExpressionUtils.mergeArguments(arg0, arg1, arg2, varArgs));
+ this(false, arg0, arg1, arg2, varArgs);
}
/**
* constructor with 3 or more arguments.
*/
public SequenceMatch(boolean distinct, Expression arg0, Expression arg1, Expression arg2, Expression... varArgs) {
- super("sequence_match", distinct,
- ExpressionUtils.mergeArguments(arg0, arg1, arg2, varArgs));
+ this(distinct, false, arg0, arg1, arg2, varArgs);
+ }
+
+ public SequenceMatch(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1,
+ Expression arg2, Expression... varArgs) {
+ super("sequence_match", distinct, alwaysNullable, ExpressionUtils.mergeArguments(arg0, arg1, arg2, varArgs));
}
/**
@@ -70,8 +73,14 @@ public class SequenceMatch extends AggregateFunction
@Override
public SequenceMatch withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() >= 3);
- return new SequenceMatch(distinct, children.get(0), children.get(1), children.get(2),
- children.subList(3, children.size()).toArray(new Expression[0]));
+ return new SequenceMatch(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2), children.subList(3, children.size()).toArray(new Expression[0]));
+ }
+
+ @Override
+ public SequenceMatch withAlwaysNullable(boolean alwaysNullable) {
+ return new SequenceMatch(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2), children.subList(3, children.size()).toArray(new Expression[0]));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/StddevSamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/StddevSamp.java
index 971af51a576..234715b28dd 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/StddevSamp.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/StddevSamp.java
@@ -19,7 +19,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import org.apache.doris.nereids.trees.expressions.functions.DecimalStddevPrecision;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
@@ -40,8 +39,8 @@ import java.util.List;
/**
* AggregateFunction 'stddev_samp'. This class is generated by GenerateFunction.
*/
-public class StddevSamp extends AggregateFunction
- implements UnaryExpression, ExplicitlyCastableSignature, AlwaysNullable,
+public class StddevSamp extends NullableAggregateFunction
+ implements UnaryExpression, ExplicitlyCastableSignature,
StdDevOrVarianceFunction, DecimalStddevPrecision {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
@@ -58,14 +57,18 @@ public class StddevSamp extends AggregateFunction
* constructor with 1 argument.
*/
public StddevSamp(Expression arg) {
- super("stddev_samp", arg);
+ this(false, arg);
}
/**
* constructor with 1 argument.
*/
public StddevSamp(boolean distinct, Expression arg) {
- super("stddev_samp", distinct, arg);
+ this(distinct, false, arg);
+ }
+
+ public StddevSamp(boolean distinct, boolean alwaysNullable, Expression arg) {
+ super("stddev_samp", distinct, alwaysNullable, arg);
}
/**
@@ -74,7 +77,12 @@ public class StddevSamp extends AggregateFunction
@Override
public StddevSamp withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 1);
- return new StddevSamp(distinct, children.get(0));
+ return new StddevSamp(distinct, alwaysNullable, children.get(0));
+ }
+
+ @Override
+ public StddevSamp withAlwaysNullable(boolean alwaysNullable) {
+ return new StddevSamp(distinct, alwaysNullable, children.get(0));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java
index 5c1bf625a9f..ccf3a8882c7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopN.java
@@ -21,7 +21,6 @@ import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.IntegerType;
import org.apache.doris.nereids.types.StringType;
@@ -35,8 +34,8 @@ import java.util.List;
/**
* AggregateFunction 'topn'. This class is generated by GenerateFunction.
*/
-public class TopN extends AggregateFunction
- implements ExplicitlyCastableSignature, PropagateNullable {
+public class TopN extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(VarcharType.SYSTEM_DEFAULT).args(VarcharType.SYSTEM_DEFAULT, IntegerType.INSTANCE),
@@ -51,28 +50,36 @@ public class TopN extends AggregateFunction
* constructor with 2 arguments.
*/
public TopN(Expression arg0, Expression arg1) {
- super("topn", arg0, arg1);
+ this(false, arg0, arg1);
}
/**
* constructor with 2 arguments.
*/
public TopN(boolean distinct, Expression arg0, Expression arg1) {
- super("topn", distinct, arg0, arg1);
+ this(distinct, false, arg0, arg1);
+ }
+
+ public TopN(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1) {
+ super("topn", distinct, alwaysNullable, arg0, arg1);
}
/**
* constructor with 3 arguments.
*/
public TopN(Expression arg0, Expression arg1, Expression arg2) {
- super("topn", arg0, arg1, arg2);
+ this(false, arg0, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public TopN(boolean distinct, Expression arg0, Expression arg1, Expression arg2) {
- super("topn", distinct, arg0, arg1, arg2);
+ this(distinct, false, arg0, arg1, arg2);
+ }
+
+ public TopN(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1, Expression arg2) {
+ super("topn", distinct, alwaysNullable, arg0, arg1, arg2);
}
@Override
@@ -97,9 +104,18 @@ public class TopN extends AggregateFunction
Preconditions.checkArgument(children.size() == 2
|| children.size() == 3);
if (children.size() == 2) {
- return new TopN(distinct, children.get(0), children.get(1));
+ return new TopN(distinct, alwaysNullable, children.get(0), children.get(1));
+ } else {
+ return new TopN(distinct, alwaysNullable, children.get(0), children.get(1), children.get(2));
+ }
+ }
+
+ @Override
+ public NullableAggregateFunction withAlwaysNullable(boolean alwaysNullable) {
+ if (children.size() == 2) {
+ return new TopN(distinct, alwaysNullable, children.get(0), children.get(1));
} else {
- return new TopN(distinct, children.get(0), children.get(1), children.get(2));
+ return new TopN(distinct, alwaysNullable, children.get(0), children.get(1), children.get(2));
}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNArray.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNArray.java
index 6a63a5e1c83..79a0a0b5f6c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNArray.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNArray.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.ArrayType;
import org.apache.doris.nereids.types.IntegerType;
@@ -35,8 +34,8 @@ import java.util.List;
/**
* AggregateFunction 'topn_array'. This class is generated by GenerateFunction.
*/
-public class TopNArray extends AggregateFunction
- implements ExplicitlyCastableSignature, PropagateNullable {
+public class TopNArray extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(ArrayType.of(new FollowToAnyDataType(0)))
@@ -49,28 +48,36 @@ public class TopNArray extends AggregateFunction
* constructor with 2 arguments.
*/
public TopNArray(Expression arg0, Expression arg1) {
- super("topn_array", arg0, arg1);
+ this(false, arg0, arg1);
}
/**
* constructor with 2 arguments.
*/
public TopNArray(boolean distinct, Expression arg0, Expression arg1) {
- super("topn_array", distinct, arg0, arg1);
+ this(distinct, false, arg0, arg1);
+ }
+
+ public TopNArray(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1) {
+ super("topn_array", distinct, alwaysNullable, arg0, arg1);
}
/**
* constructor with 3 arguments.
*/
public TopNArray(Expression arg0, Expression arg1, Expression arg2) {
- super("topn_array", arg0, arg1, arg2);
+ this(false, arg0, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public TopNArray(boolean distinct, Expression arg0, Expression arg1, Expression arg2) {
- super("topn_array", distinct, arg0, arg1, arg2);
+ this(distinct, false, arg0, arg1, arg2);
+ }
+
+ public TopNArray(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1, Expression arg2) {
+ super("topn_array", distinct, alwaysNullable, arg0, arg1, arg2);
}
/**
@@ -81,9 +88,18 @@ public class TopNArray extends AggregateFunction
Preconditions.checkArgument(children.size() == 2
|| children.size() == 3);
if (children.size() == 2) {
- return new TopNArray(distinct, children.get(0), children.get(1));
+ return new TopNArray(distinct, alwaysNullable, children.get(0), children.get(1));
+ } else {
+ return new TopNArray(distinct, alwaysNullable, children.get(0), children.get(1), children.get(2));
+ }
+ }
+
+ @Override
+ public NullableAggregateFunction withAlwaysNullable(boolean alwaysNullable) {
+ if (children.size() == 2) {
+ return new TopNArray(distinct, alwaysNullable, children.get(0), children.get(1));
} else {
- return new TopNArray(distinct, children.get(0), children.get(1), children.get(2));
+ return new TopNArray(distinct, alwaysNullable, children.get(0), children.get(1), children.get(2));
}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java
index c9e28f57753..40ab65ff4b4 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/TopNWeighted.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
-import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.ArrayType;
import org.apache.doris.nereids.types.BigIntType;
@@ -48,8 +47,8 @@ import java.util.List;
/**
* AggregateFunction 'topn_weighted'. This class is generated by GenerateFunction.
*/
-public class TopNWeighted extends AggregateFunction
- implements ExplicitlyCastableSignature, PropagateNullable {
+public class TopNWeighted extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(ArrayType.of(BooleanType.INSTANCE))
@@ -124,28 +123,37 @@ public class TopNWeighted extends AggregateFunction
* constructor with 3 arguments.
*/
public TopNWeighted(Expression arg0, Expression arg1, Expression arg2) {
- super("topn_weighted", arg0, arg1, arg2);
+ this(false, arg0, arg1, arg2);
}
/**
* constructor with 3 arguments.
*/
public TopNWeighted(boolean distinct, Expression arg0, Expression arg1, Expression arg2) {
- super("topn_weighted", distinct, arg0, arg1, arg2);
+ this(distinct, false, arg0, arg1, arg2);
+ }
+
+ public TopNWeighted(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1, Expression arg2) {
+ super("topn_weighted", distinct, alwaysNullable, arg0, arg1, arg2);
}
/**
* constructor with 4 arguments.
*/
public TopNWeighted(Expression arg0, Expression arg1, Expression arg2, Expression arg3) {
- super("topn_weighted", arg0, arg1, arg2, arg3);
+ this(false, arg0, arg1, arg2, arg3);
}
/**
* constructor with 4 arguments.
*/
public TopNWeighted(boolean distinct, Expression arg0, Expression arg1, Expression arg2, Expression arg3) {
- super("topn_weighted", distinct, arg0, arg1, arg2, arg3);
+ this(distinct, false, arg0, arg1, arg2, arg3);
+ }
+
+ public TopNWeighted(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1,
+ Expression arg2, Expression arg3) {
+ super("topn_weighted", distinct, alwaysNullable, arg0, arg1, arg2);
}
/**
@@ -156,9 +164,22 @@ public class TopNWeighted extends AggregateFunction
Preconditions.checkArgument(children.size() == 3
|| children.size() == 4);
if (children.size() == 3) {
- return new TopNWeighted(distinct, children.get(0), children.get(1), children.get(2));
+ return new TopNWeighted(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2));
+ } else {
+ return new TopNWeighted(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2), children.get(3));
+ }
+ }
+
+ @Override
+ public NullableAggregateFunction withAlwaysNullable(boolean alwaysNullable) {
+ if (children.size() == 3) {
+ return new TopNWeighted(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2));
} else {
- return new TopNWeighted(distinct, children.get(0), children.get(1), children.get(2), children.get(3));
+ return new TopNWeighted(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2), children.get(3));
}
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/VarianceSamp.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/VarianceSamp.java
index 8196be54ab9..65f2018d11e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/VarianceSamp.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/VarianceSamp.java
@@ -19,7 +19,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -39,9 +38,9 @@ import java.util.List;
/**
* AggregateFunction 'variance_samp'. This class is generated by GenerateFunction.
*/
-public class VarianceSamp extends AggregateFunction
+public class VarianceSamp extends NullableAggregateFunction
implements UnaryExpression, ExplicitlyCastableSignature,
- StdDevOrVarianceFunction, AlwaysNullable {
+ StdDevOrVarianceFunction {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(DoubleType.INSTANCE).args(DoubleType.INSTANCE),
@@ -57,14 +56,18 @@ public class VarianceSamp extends AggregateFunction
* constructor with 1 argument.
*/
public VarianceSamp(Expression arg) {
- super("variance_samp", arg);
+ this(false, arg);
}
/**
* constructor with 1 argument.
*/
public VarianceSamp(boolean distinct, Expression arg) {
- super("variance_samp", distinct, arg);
+ this(distinct, false, arg);
+ }
+
+ public VarianceSamp(boolean distinct, boolean alwaysNullable, Expression arg) {
+ super("variance_samp", distinct, alwaysNullable, arg);
}
/**
@@ -73,7 +76,12 @@ public class VarianceSamp extends AggregateFunction
@Override
public VarianceSamp withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() == 1);
- return new VarianceSamp(distinct, children.get(0));
+ return new VarianceSamp(distinct, alwaysNullable, children.get(0));
+ }
+
+ @Override
+ public VarianceSamp withAlwaysNullable(boolean alwaysNullable) {
+ return new VarianceSamp(distinct, alwaysNullable, children.get(0));
}
@Override
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java
index d19f63f658f..11d920530e8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java
@@ -20,7 +20,6 @@ package org.apache.doris.nereids.trees.expressions.functions.agg;
import org.apache.doris.catalog.FunctionSignature;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.functions.AlwaysNotNullable;
import org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
import org.apache.doris.nereids.types.BigIntType;
@@ -41,8 +40,8 @@ import java.util.List;
/**
* AggregateFunction 'window_funnel'. This class is generated by GenerateFunction.
*/
-public class WindowFunnel extends AggregateFunction
- implements ExplicitlyCastableSignature, AlwaysNotNullable {
+public class WindowFunnel extends NullableAggregateFunction
+ implements ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(IntegerType.INSTANCE)
@@ -53,7 +52,7 @@ public class WindowFunnel extends AggregateFunction
* constructor with 4 or more arguments.
*/
public WindowFunnel(Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression... varArgs) {
- super("window_funnel", ExpressionUtils.mergeArguments(arg0, arg1, arg2, arg3, varArgs));
+ this(false, arg0, arg1, arg2, arg3, varArgs);
}
/**
@@ -61,7 +60,12 @@ public class WindowFunnel extends AggregateFunction
*/
public WindowFunnel(boolean distinct, Expression arg0, Expression arg1, Expression arg2,
Expression arg3, Expression... varArgs) {
- super("window_funnel", distinct,
+ this(distinct, false, arg0, arg1, arg2, arg3, varArgs);
+ }
+
+ public WindowFunnel(boolean distinct, boolean alwaysNullable, Expression arg0, Expression arg1, Expression arg2,
+ Expression arg3, Expression... varArgs) {
+ super("window_funnel", distinct, alwaysNullable,
ExpressionUtils.mergeArguments(arg0, arg1, arg2, arg3, varArgs));
}
@@ -106,7 +110,15 @@ public class WindowFunnel extends AggregateFunction
@Override
public WindowFunnel withDistinctAndChildren(boolean distinct, List<Expression> children) {
Preconditions.checkArgument(children.size() >= 4);
- return new WindowFunnel(distinct, children.get(0), children.get(1), children.get(2), children.get(3),
+ return new WindowFunnel(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2), children.get(3),
+ children.subList(4, children.size()).toArray(new Expression[0]));
+ }
+
+ @Override
+ public WindowFunnel withAlwaysNullable(boolean alwaysNullable) {
+ return new WindowFunnel(distinct, alwaysNullable, children.get(0), children.get(1),
+ children.get(2), children.get(3),
children.subList(4, children.size()).toArray(new Expression[0]));
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java
index 9a2593b8a8d..711eaacc15e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/visitor/AggregateFunctionVisitor.java
@@ -91,7 +91,7 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitAnyValue(AnyValue anyValue, C context) {
- return visitAggregateFunction(anyValue, context);
+ return visitNullableAggregateFunction(anyValue, context);
}
default R visitArrayAgg(ArrayAgg arrayAgg, C context) {
@@ -103,7 +103,7 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitAvgWeighted(AvgWeighted avgWeighted, C context) {
- return visitAggregateFunction(avgWeighted, context);
+ return visitNullableAggregateFunction(avgWeighted, context);
}
default R visitBitmapAgg(BitmapAgg bitmapAgg, C context) {
@@ -135,7 +135,7 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitCorr(Corr corr, C context) {
- return visitAggregateFunction(corr, context);
+ return visitNullableAggregateFunction(corr, context);
}
default R visitCount(Count count, C context) {
@@ -147,11 +147,11 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitCovar(Covar covar, C context) {
- return visitAggregateFunction(covar, context);
+ return visitNullableAggregateFunction(covar, context);
}
default R visitCovarSamp(CovarSamp covarSamp, C context) {
- return visitAggregateFunction(covarSamp, context);
+ return visitNullableAggregateFunction(covarSamp, context);
}
default R visitMultiDistinctCount(MultiDistinctCount multiDistinctCount, C context) {
@@ -159,11 +159,11 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitMultiDistinctGroupConcat(MultiDistinctGroupConcat multiDistinctGroupConcat, C context) {
- return visitAggregateFunction(multiDistinctGroupConcat, context);
+ return visitNullableAggregateFunction(multiDistinctGroupConcat, context);
}
default R visitMultiDistinctSum(MultiDistinctSum multiDistinctSum, C context) {
- return visitAggregateFunction(multiDistinctSum, context);
+ return visitNullableAggregateFunction(multiDistinctSum, context);
}
default R visitMultiDistinctSum0(MultiDistinctSum0 multiDistinctSum0, C context) {
@@ -251,11 +251,11 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitPercentileApprox(PercentileApprox percentileApprox, C context) {
- return visitAggregateFunction(percentileApprox, context);
+ return visitNullableAggregateFunction(percentileApprox, context);
}
default R visitPercentileApprox(PercentileApproxWeighted percentileApprox, C context) {
- return visitAggregateFunction(percentileApprox, context);
+ return visitNullableAggregateFunction(percentileApprox, context);
}
default R visitPercentileArray(PercentileArray percentileArray, C context) {
@@ -267,7 +267,7 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitRetention(Retention retention, C context) {
- return visitAggregateFunction(retention, context);
+ return visitNullableAggregateFunction(retention, context);
}
default R visitSequenceCount(SequenceCount sequenceCount, C context) {
@@ -275,15 +275,15 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitSequenceMatch(SequenceMatch sequenceMatch, C context) {
- return visitAggregateFunction(sequenceMatch, context);
+ return visitNullableAggregateFunction(sequenceMatch, context);
}
default R visitStddev(Stddev stddev, C context) {
- return visitAggregateFunction(stddev, context);
+ return visitNullableAggregateFunction(stddev, context);
}
default R visitStddevSamp(StddevSamp stddevSamp, C context) {
- return visitAggregateFunction(stddevSamp, context);
+ return visitNullableAggregateFunction(stddevSamp, context);
}
default R visitSum(Sum sum, C context) {
@@ -295,27 +295,27 @@ public interface AggregateFunctionVisitor<R, C> {
}
default R visitTopN(TopN topN, C context) {
- return visitAggregateFunction(topN, context);
+ return visitNullableAggregateFunction(topN, context);
}
default R visitTopNArray(TopNArray topnArray, C context) {
- return visitAggregateFunction(topnArray, context);
+ return visitNullableAggregateFunction(topnArray, context);
}
default R visitTopNWeighted(TopNWeighted topnWeighted, C context) {
- return visitAggregateFunction(topnWeighted, context);
+ return visitNullableAggregateFunction(topnWeighted, context);
}
default R visitVariance(Variance variance, C context) {
- return visitAggregateFunction(variance, context);
+ return visitNullableAggregateFunction(variance, context);
}
default R visitVarianceSamp(VarianceSamp varianceSamp, C context) {
- return visitAggregateFunction(varianceSamp, context);
+ return visitNullableAggregateFunction(varianceSamp, context);
}
default R visitWindowFunnel(WindowFunnel windowFunnel, C context) {
- return visitAggregateFunction(windowFunnel, context);
+ return visitNullableAggregateFunction(windowFunnel, context);
}
default R visitMergeCombinator(MergeCombinator combinator, C context) {
diff --git a/regression-test/data/correctness_p0/test_select_stddev_variance_window.out b/regression-test/data/correctness_p0/test_select_stddev_variance_window.out
index a5cce0879b1..0c6ee4f84bc 100644
--- a/regression-test/data/correctness_p0/test_select_stddev_variance_window.out
+++ b/regression-test/data/correctness_p0/test_select_stddev_variance_window.out
@@ -121,9 +121,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 2.1213203435596424
-5 \N
+5 0.0
6 2.8284271247461903
7 2.5166114784235836
8 17770.84139820059
@@ -153,21 +153,21 @@
15 867.8342295623053
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 11759.932436232868
@@ -183,12 +183,12 @@
11 2.1213203435596424
12 32767.330742677226
13 23350.08012834217
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 2.1213203435596424
4 2.5166114784235836
5 2.8284271247461903
@@ -325,9 +325,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 4.5
-5 \N
+5 0.0
6 8.0
7 6.333333333333334
8 3.15802804E8
@@ -357,21 +357,21 @@
15 753136.25
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 1.382960109047619E8
@@ -387,12 +387,12 @@
11 4.5
12 1.073697964E9
13 5.45226242E8
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 4.5
4 6.333333333333334
5 8.0
diff --git a/regression-test/data/function_p0/test_agg_foreach.out b/regression-test/data/function_p0/test_agg_foreach.out
index c7d50a501cb..c37f6d919c5 100644
--- a/regression-test/data/function_p0/test_agg_foreach.out
+++ b/regression-test/data/function_p0/test_agg_foreach.out
@@ -3,10 +3,10 @@
[1, 2, 3] [1, 2, 3] [100, 2, 3] [100, 2, 3] [40.333333333333336, 2, 3] [85.95867768595042, 2, 3]
-- !sql --
-[121, 4, 3] [42.89781139198388, 0, 0] [52.53887449625594, 0, null] [1840.222222222222, 0, 0] [2760.333333333333, 0, null]
+[121, 4, 3] [42.89781139198388, 0, 0] [52.53887449625594, 0, 0] [1840.222222222222, 0, 0] [2760.333333333333, 0, 0]
-- !sql --
-[1840.2222222222222, 0, 0] [2760.3333333333335, 0, null] [1, 0, 0]
+[1840.2222222222222, 0, 0] [2760.3333333333335, 0, 0] [1, 0, 0]
-- !sql --
["{"20":1,"100":1,"1":1}", "{"2":2}", "{"3":1}"] ["{"20":1,"100":1,"1":1}", "{"2":2}", "{"3":1}"] [[100, 20, 1], [2], [3]] [[100, 20, 1], [2], [3]]
@@ -24,7 +24,7 @@
[[1], [2, 2, 2], [3]]
-- !sql --
-[null, null, null]
+[0, 0, 0]
-- !sql --
[0, 2, 3] [117, 2, 3] [113, 0, 3]
diff --git a/regression-test/data/function_p0/test_agg_foreach_notnull.out b/regression-test/data/function_p0/test_agg_foreach_notnull.out
index c7d50a501cb..c37f6d919c5 100644
--- a/regression-test/data/function_p0/test_agg_foreach_notnull.out
+++ b/regression-test/data/function_p0/test_agg_foreach_notnull.out
@@ -3,10 +3,10 @@
[1, 2, 3] [1, 2, 3] [100, 2, 3] [100, 2, 3] [40.333333333333336, 2, 3] [85.95867768595042, 2, 3]
-- !sql --
-[121, 4, 3] [42.89781139198388, 0, 0] [52.53887449625594, 0, null] [1840.222222222222, 0, 0] [2760.333333333333, 0, null]
+[121, 4, 3] [42.89781139198388, 0, 0] [52.53887449625594, 0, 0] [1840.222222222222, 0, 0] [2760.333333333333, 0, 0]
-- !sql --
-[1840.2222222222222, 0, 0] [2760.3333333333335, 0, null] [1, 0, 0]
+[1840.2222222222222, 0, 0] [2760.3333333333335, 0, 0] [1, 0, 0]
-- !sql --
["{"20":1,"100":1,"1":1}", "{"2":2}", "{"3":1}"] ["{"20":1,"100":1,"1":1}", "{"2":2}", "{"3":1}"] [[100, 20, 1], [2], [3]] [[100, 20, 1], [2], [3]]
@@ -24,7 +24,7 @@
[[1], [2, 2, 2], [3]]
-- !sql --
-[null, null, null]
+[0, 0, 0]
-- !sql --
[0, 2, 3] [117, 2, 3] [113, 0, 3]
diff --git a/regression-test/data/inverted_index_p1/tpcds_sf1_index/sql/q17.out b/regression-test/data/inverted_index_p1/tpcds_sf1_index/sql/q17.out
index eb02fc88450..18141c18f70 100644
--- a/regression-test/data/inverted_index_p1/tpcds_sf1_index/sql/q17.out
+++ b/regression-test/data/inverted_index_p1/tpcds_sf1_index/sql/q17.out
@@ -1,4 +1,3 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !q17 --
-AAAAAAAAKPFEAAAA Recently right TN 1 99.0 \N \N 1 66.0 \N \N 1 32.0 \N \N
-
+AAAAAAAAKPFEAAAA Recently right TN 1 99.0 0.0 0.0 1 66.0 0.0 0.0 1 32.0 0.0 0.0
diff --git a/regression-test/data/nereids_function_p0/agg_function/agg.out b/regression-test/data/nereids_function_p0/agg_function/agg.out
index 8bbe343ccb0..a84deaf7bac 100644
--- a/regression-test/data/nereids_function_p0/agg_function/agg.out
+++ b/regression-test/data/nereids_function_p0/agg_function/agg.out
@@ -3247,7 +3247,7 @@
12 1
-- !sql_sequence_match_String_DateV2_Boolean_gb --
-false
+\N
true
false
@@ -3255,7 +3255,7 @@ false
true
-- !sql_sequence_match_String_DateV2_Boolean_agg_phase_1 --
-0 false
+0 \N
1 false
1 false
1 false
@@ -3273,7 +3273,7 @@ true
12 true
-- !sql_sequence_match_String_DateV2_Boolean_agg_phase_3 --
-0 false
+0 \N
7 true
5 false
@@ -3305,7 +3305,7 @@ true
12 true
-- !sql_sequence_match_String_DateV2_Boolean_agg_phase_3_notnull --
-0 false
+0 \N
7 true
5 false
@@ -3313,7 +3313,7 @@ true
12 true
-- !sql_sequence_match_String_DateTime_Boolean_gb --
-false
+\N
true
false
@@ -3321,7 +3321,7 @@ false
true
-- !sql_sequence_match_String_DateTime_Boolean_agg_phase_1 --
-0 false
+0 \N
1 false
1 false
1 false
@@ -3339,7 +3339,7 @@ true
12 true
-- !sql_sequence_match_String_DateTime_Boolean_agg_phase_3 --
-0 false
+0 \N
7 true
5 false
@@ -3371,7 +3371,7 @@ true
12 true
-- !sql_sequence_match_String_DateTime_Boolean_agg_phase_3_notnull --
-0 false
+0 \N
7 true
5 false
@@ -3379,7 +3379,7 @@ true
12 true
-- !sql_sequence_match_String_DateTimeV2_Boolean_gb --
-false
+\N
true
false
@@ -3387,7 +3387,7 @@ false
true
-- !sql_sequence_match_String_DateTimeV2_Boolean_agg_phase_1 --
-0 false
+0 \N
1 false
1 false
1 false
@@ -3405,7 +3405,7 @@ true
12 true
-- !sql_sequence_match_String_DateTimeV2_Boolean_agg_phase_3 --
-0 false
+0 \N
7 true
5 false
@@ -3437,7 +3437,7 @@ true
12 true
-- !sql_sequence_match_String_DateTimeV2_Boolean_agg_phase_3_notnull --
-0 false
+0 \N
7 true
5 false
@@ -3910,18 +3910,18 @@ true
-- !sql_stddev_samp_TinyInt_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_TinyInt_agg_phase_2 --
12 3.605551275463989
@@ -3942,18 +3942,18 @@ true
3.6055512754639896
-- !sql_stddev_samp_TinyInt_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_TinyInt_agg_phase_2_notnull --
12 3.605551275463989
@@ -3976,18 +3976,18 @@ true
-- !sql_stddev_samp_SmallInt_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_SmallInt_agg_phase_2 --
12 3.605551275463989
@@ -4008,18 +4008,18 @@ true
3.605551275463989
-- !sql_stddev_samp_SmallInt_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_SmallInt_agg_phase_2_notnull --
12 3.605551275463989
@@ -4042,18 +4042,18 @@ true
-- !sql_stddev_samp_Integer_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_Integer_agg_phase_2 --
12 3.605551275463989
@@ -4071,21 +4071,21 @@ true
1.5811388300841898
-- !sql_stddev_samp_Integer_notnull --
-3.605551275463989
+3.6055512754639896
-- !sql_stddev_samp_Integer_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_Integer_agg_phase_2_notnull --
12 3.605551275463989
@@ -4108,18 +4108,18 @@ true
-- !sql_stddev_samp_BigInt_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_BigInt_agg_phase_2 --
12 3.605551275463989
@@ -4140,18 +4140,18 @@ true
3.6055512754639896
-- !sql_stddev_samp_BigInt_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_BigInt_agg_phase_2_notnull --
12 3.605551275463989
@@ -4174,18 +4174,18 @@ true
-- !sql_stddev_samp_Float_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_Float_agg_phase_2 --
12 0.3605551333887302
@@ -4206,29 +4206,29 @@ true
0.3605551333887302
-- !sql_stddev_samp_Float_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-
--- !sql_stddev_samp_Float_agg_phase_2_notnull --
-12 0.3605551333887302
-
--- !sql_stddev_samp_Float_agg_phase_3_notnull --
-0 \N
-7 0.2160246891421743
-5 0.15811390185706375
-
--- !sql_stddev_samp_Float_agg_phase_4_notnull --
-12 0.3605551333887302
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+
+-- !sql_stddev_samp_Float_agg_phase_2_notnull --
+12 0.3605551333887302
+
+-- !sql_stddev_samp_Float_agg_phase_3_notnull --
+0 \N
+7 0.2160246891421743
+5 0.15811390185706375
+
+-- !sql_stddev_samp_Float_agg_phase_4_notnull --
+12 0.3605551333887302
-- !sql_stddev_samp_Double_gb --
\N
@@ -4240,18 +4240,18 @@ true
-- !sql_stddev_samp_Double_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_Double_agg_phase_2 --
12 0.3605551275463989
@@ -4272,18 +4272,18 @@ true
0.36055512754639896
-- !sql_stddev_samp_Double_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_Double_agg_phase_2_notnull --
12 0.36055512754639896
@@ -4298,18 +4298,18 @@ true
-- !sql_stddev_samp_DecimalV2_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_DecimalV2_agg_phase_2 --
12 0.36055512754639896
@@ -4323,18 +4323,18 @@ true
12 0.3605551275463989
-- !sql_stddev_samp_DecimalV2_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_stddev_samp_DecimalV2_agg_phase_2_notnull --
12 0.3605551275463989
@@ -6043,18 +6043,18 @@ true
-- !sql_variance_samp_TinyInt_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_TinyInt_agg_phase_2 --
12 13.0
@@ -6075,18 +6075,18 @@ true
13.0
-- !sql_variance_samp_TinyInt_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_TinyInt_agg_phase_2_notnull --
12 13.0
@@ -6109,18 +6109,18 @@ true
-- !sql_variance_samp_SmallInt_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_SmallInt_agg_phase_2 --
12 13.0
@@ -6141,18 +6141,18 @@ true
13.0
-- !sql_variance_samp_SmallInt_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_SmallInt_agg_phase_2_notnull --
12 13.0
@@ -6175,18 +6175,18 @@ true
-- !sql_variance_samp_Integer_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_Integer_agg_phase_2 --
12 13.0
@@ -6207,18 +6207,18 @@ true
13.0
-- !sql_variance_samp_Integer_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_Integer_agg_phase_2_notnull --
12 13.0
@@ -6241,18 +6241,18 @@ true
-- !sql_variance_samp_BigInt_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_BigInt_agg_phase_2 --
12 13.0
@@ -6273,18 +6273,18 @@ true
13.0
-- !sql_variance_samp_BigInt_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_BigInt_agg_phase_2_notnull --
12 13.0
@@ -6307,18 +6307,18 @@ true
-- !sql_variance_samp_Float_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_Float_agg_phase_2 --
12 0.13000000421296498
@@ -6339,18 +6339,18 @@ true
0.130000004212965
-- !sql_variance_samp_Float_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_Float_agg_phase_2_notnull --
12 0.130000004212965
@@ -6373,18 +6373,18 @@ true
-- !sql_variance_samp_Double_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_Double_agg_phase_2 --
12 0.13
@@ -6405,18 +6405,18 @@ true
0.13
-- !sql_variance_samp_Double_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_Double_agg_phase_2_notnull --
12 0.12999999999999998
@@ -6431,18 +6431,18 @@ true
-- !sql_variance_samp_DecimalV2_agg_phase_1 --
0 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_DecimalV2_agg_phase_2 --
12 0.13
@@ -6456,18 +6456,18 @@ true
12 0.12999999999999998
-- !sql_variance_samp_DecimalV2_agg_phase_1_notnull --
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
-1 \N
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
+1 0.0
-- !sql_variance_samp_DecimalV2_agg_phase_2_notnull --
12 0.13
@@ -6481,7 +6481,7 @@ true
12 0.13
-- !sql_window_funnel_BigInt_String_DateTime_Boolean_gb --
-0
+\N
1
0
@@ -6489,7 +6489,7 @@ true
1
-- !sql_window_funnel_BigInt_String_DateTime_Boolean_agg_phase_1 --
-0 0
+0 \N
1 1
1 0
1 0
@@ -6507,7 +6507,7 @@ true
12 1
-- !sql_window_funnel_BigInt_String_DateTime_Boolean_agg_phase_3 --
-0 0
+0 \N
7 1
5 0
@@ -6539,7 +6539,7 @@ true
12 1
-- !sql_window_funnel_BigInt_String_DateTime_Boolean_agg_phase_3_notnull --
-0 0
+0 \N
7 1
5 0
@@ -6547,7 +6547,7 @@ true
12 1
-- !sql_window_funnel_BigInt_String_DateTimeV2_Boolean_gb --
-0
+\N
1
0
@@ -6555,7 +6555,7 @@ true
1
-- !sql_window_funnel_BigInt_String_DateTimeV2_Boolean_agg_phase_1 --
-0 0
+0 \N
1 1
1 0
1 0
@@ -6573,7 +6573,7 @@ true
12 1
-- !sql_window_funnel_BigInt_String_DateTimeV2_Boolean_agg_phase_3 --
-0 0
+0 \N
7 1
5 0
@@ -6605,7 +6605,7 @@ true
12 1
-- !sql_window_funnel_BigInt_String_DateTimeV2_Boolean_agg_phase_3_notnull --
-0 0
+0 \N
7 1
5 0
diff --git a/regression-test/data/nereids_p0/aggregate/agg_nullable.out b/regression-test/data/nereids_p0/aggregate/agg_nullable.out
new file mode 100644
index 00000000000..697e9478570
--- /dev/null
+++ b/regression-test/data/nereids_p0/aggregate/agg_nullable.out
@@ -0,0 +1,433 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_any_value --
+\N
+
+-- !select_any_value2 --
+
+-- !select_any_value_n --
+\N
+
+-- !select_sum_foreach --
+\N
+
+-- !select_sum_foreach2 --
+
+-- !select_sum_foreach_n --
+\N
+
+-- !select_approx_count_distinct --
+0
+
+-- !select_approx_count_distinct2 --
+
+-- !select_approx_count_distinct_n --
+0
+
+-- !select_collect_set --
+[]
+
+-- !select_collect_set2 --
+
+-- !select_collect_set_n --
+[]
+
+-- !select_collect_list --
+[]
+
+-- !select_collect_list2 --
+
+-- !select_collect_list_n --
+[]
+
+-- !select_corr --
+\N
+
+-- !select_corr2 --
+
+-- !select_corr_n --
+\N
+
+-- !select_percentile_array --
+[]
+
+-- !select_percentile_array2 --
+
+-- !select_percentile_array_n --
+[]
+
+-- !select_quantile_union --
+\N
+
+-- !select_quantile_union2 --
+
+-- !select_quantile_union_n --
+\N
+
+-- !select_count_by_enum --
+[]
+
+-- !select_count_by_enum2 --
+
+-- !select_count_by_enum_n --
+[]
+
+-- !select_avg_weighted --
+\N
+
+-- !select_avg_weighted2 --
+
+-- !select_avg_weighted_n --
+\N
+
+-- !select_bitmap_intersect --
+\N
+
+-- !select_bitmap_intersect2 --
+
+-- !select_bitmap_intersect_n --
+\N
+
+-- !select_bitmap_agg --
+\N
+
+-- !select_bitmap_agg2 --
+
+-- !select_bitmap_agg_n --
+\N
+
+-- !select_bitmap_union --
+\N
+
+-- !select_bitmap_union2 --
+
+-- !select_bitmap_union_n --
+\N
+
+-- !select_bitmap_union_count --
+0
+
+-- !select_bitmap_union_count2 --
+
+-- !select_bitmap_union_count_n --
+0
+
+-- !select_bitmap_union_int --
+0
+
+-- !select_bitmap_union_int2 --
+
+-- !select_bitmap_union_int_n --
+0
+
+-- !select_group_array_intersect --
+[]
+
+-- !select_group_array_intersect2 --
+
+-- !select_group_array_intersect_n --
+[]
+
+-- !select_group_bit_and --
+\N
+
+-- !select_group_bit_and2 --
+
+-- !select_group_bit_and_n --
+\N
+
+-- !select_group_bit_or --
+\N
+
+-- !select_group_bit_or2 --
+
+-- !select_group_bit_or_n --
+\N
+
+-- !select_group_bit_xor --
+\N
+
+-- !select_group_bit_xor2 --
+
+-- !select_group_bit_xor_n --
+\N
+
+-- !select_group_bitmap_xor --
+\N
+
+-- !select_group_bitmap_xor2 --
+
+-- !select_group_bitmap_xor_n --
+\N
+
+-- !select_hll_union_agg --
+0
+
+-- !select_hll_union_agg2 --
+
+-- !select_hll_union_agg_n --
+0
+
+-- !select_hll_union --
+\N
+
+-- !select_hll_union2 --
+
+-- !select_hll_union_n --
+\N
+
+-- !select_intersect_count --
+0
+
+-- !select_intersect_count2 --
+
+-- !select_intersect_count_n --
+0
+
+-- !select_group_concat --
+\N
+
+-- !select_group_concat2 --
+
+-- !select_group_concat_n --
+\N
+
+-- !select_multi_distinct_group_concat --
+\N
+
+-- !select_multi_distinct_group_concat2 --
+
+-- !select_multi_distinct_group_concat_n --
+\N
+
+-- !select_multi_distinct_sum0 --
+0
+
+-- !select_multi_distinct_sum02 --
+
+-- !select_multi_distinct_sum0_n --
+0
+
+-- !select_multi_distinct_sum --
+\N
+
+-- !select_multi_distinct_sum2 --
+
+-- !select_multi_distinct_sum_n --
+\N
+
+-- !select_histogram --
+{"num_buckets":0,"buckets":[]}
+
+-- !select_histogram2 --
+
+-- !select_histogram_n --
+{"num_buckets":0,"buckets":[]}
+
+-- !select_max_by --
+\N
+
+-- !select_max_by2 --
+
+-- !select_max_by_n --
+\N
+
+-- !select_min_by --
+\N
+
+-- !select_min_by2 --
+
+-- !select_min_by_n --
+\N
+
+-- !select_multi_distinct_count --
+0
+
+-- !select_multi_distinct_count2 --
+
+-- !select_multi_distinct_count_n --
+0
+
+-- !select_ndv --
+0
+
+-- !select_ndv2 --
+
+-- !select_ndv_n --
+0
+
+-- !select_covar --
+\N
+
+-- !select_covar2 --
+
+-- !select_covar_n --
+\N
+
+-- !select_covar_samp --
+\N
+
+-- !select_covar_samp2 --
+
+-- !select_covar_samp_n --
+\N
+
+-- !select_percentile --
+\N
+
+-- !select_percentile2 --
+
+-- !select_percentile_n --
+\N
+
+-- !select_percentile_approx --
+\N
+
+-- !select_percentile_approx2 --
+
+-- !select_percentile_approx_n --
+\N
+
+-- !select_percentile_approx_weighted --
+\N
+
+-- !select_percentile_approx_weighted2 --
+
+-- !select_percentile_approx_weighted_n --
+\N
+
+-- !select_sequence_count --
+0
+
+-- !select_sequence_count2 --
+
+-- !select_sequence_count_n --
+0
+
+-- !select_sequence_match --
+\N
+
+-- !select_sequence_match2 --
+
+-- !select_sequence_match_n --
+\N
+
+-- !select_stddev --
+\N
+
+-- !select_stddev2 --
+
+-- !select_stddev_n --
+\N
+
+-- !select_stddev_pop --
+\N
+
+-- !select_stddev_pop2 --
+
+-- !select_stddev_pop_n --
+\N
+
+-- !select_stddev_samp --
+\N
+
+-- !select_stddev_samp2 --
+
+-- !select_stddev_samp_n --
+\N
+
+-- !select_sum0 --
+0
+
+-- !select_sum02 --
+
+-- !select_sum0_n --
+0
+
+-- !select_topn --
+\N
+
+-- !select_topn2 --
+
+-- !select_topn_n --
+\N
+
+-- !select_topn_array --
+\N
+
+-- !select_topn_array2 --
+
+-- !select_topn_array_n --
+\N
+
+-- !select_topn_weighted --
+\N
+
+-- !select_topn_weighted2 --
+
+-- !select_topn_weighted_n --
+\N
+
+-- !select_variance --
+\N
+
+-- !select_variance2 --
+
+-- !select_variance_n --
+\N
+
+-- !select_var_pop --
+\N
+
+-- !select_var_pop2 --
+
+-- !select_var_pop_n --
+\N
+
+-- !select_variance_samp --
+\N
+
+-- !select_variance_samp2 --
+
+-- !select_variance_samp_n --
+\N
+
+-- !select_var_samp --
+\N
+
+-- !select_var_samp2 --
+
+-- !select_var_samp_n --
+\N
+
+-- !select_window_funnel --
+\N
+
+-- !select_window_funnel2 --
+
+-- !select_window_funnel_n --
+\N
+
+-- !select_map_agg --
+{}
+
+-- !select_map_agg2 --
+
+-- !select_map_agg_n --
+{}
+
+-- !select_array_agg --
+[]
+
+-- !select_array_agg2 --
+
+-- !select_array_agg_n --
+[]
+
+-- !select_retention --
+\N
+
+-- !select_retention2 --
+
+-- !select_retention_n --
+\N
+
diff --git a/regression-test/data/nereids_p0/aggregate/agg_nullable_2.out b/regression-test/data/nereids_p0/aggregate/agg_nullable_2.out
new file mode 100644
index 00000000000..6ebb730a5bd
--- /dev/null
+++ b/regression-test/data/nereids_p0/aggregate/agg_nullable_2.out
@@ -0,0 +1,478 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_any_value --
+50
+
+-- !select_any_value2 --
+50
+
+-- !select_any_value_n --
+100
+
+-- !select_approx_count_distinct --
+1
+
+-- !select_approx_count_distinct2 --
+1
+
+-- !select_approx_count_distinct_n --
+1
+
+-- !select_collect_set --
+[50]
+
+-- !select_collect_set2 --
+[50]
+
+-- !select_collect_set_n --
+[100]
+
+-- !select_collect_list --
+[50]
+
+-- !select_collect_list2 --
+[50]
+
+-- !select_collect_list_n --
+[100]
+
+-- !select_corr --
+0.0
+
+-- !select_corr2 --
+0.0
+
+-- !select_corr_n --
+0.0
+
+-- !select_percentile_array --
+[50, 50, 50]
+
+-- !select_percentile_array2 --
+[50, 50, 50]
+
+-- !select_percentile_array_n --
+[100, 100, 100]
+
+-- !select_quantile_union --
+\N
+
+-- !select_quantile_union2 --
+\N
+
+-- !select_quantile_union_n --
+\N
+
+-- !select_count_by_enum --
+[{"cbe":{"non-null string":1},"notnull":1,"null":0,"all":1}]
+
+-- !select_count_by_enum2 --
+[{"cbe":{"non-null string":1},"notnull":1,"null":0,"all":1}]
+
+-- !select_count_by_enum_n --
+[{"cbe":{"string":1},"notnull":1,"null":0,"all":1}]
+
+-- !select_avg_weighted --
+5.0
+
+-- !select_avg_weighted2 --
+5.0
+
+-- !select_avg_weighted_n --
+10.0
+
+-- !select_bitmap_intersect --
+\N
+
+-- !select_bitmap_intersect2 --
+\N
+
+-- !select_bitmap_intersect_n --
+\N
+
+-- !select_bitmap_agg --
+\N
+
+-- !select_bitmap_agg2 --
+\N
+
+-- !select_bitmap_agg_n --
+\N
+
+-- !select_bitmap_union --
+\N
+
+-- !select_bitmap_union2 --
+\N
+
+-- !select_bitmap_union_n --
+\N
+
+-- !select_bitmap_union_count --
+1
+
+-- !select_bitmap_union_count2 --
+1
+
+-- !select_bitmap_union_count_n --
+1
+
+-- !select_bitmap_union_int --
+1
+
+-- !select_bitmap_union_int2 --
+1
+
+-- !select_bitmap_union_int_n --
+1
+
+-- !select_group_array_intersect --
+[4, 5, 6]
+
+-- !select_group_array_intersect2 --
+[4, 5, 6]
+
+-- !select_group_array_intersect_n --
+[2, 1, 3]
+
+-- !select_group_bit_and --
+50
+
+-- !select_group_bit_and2 --
+50
+
+-- !select_group_bit_and_n --
+100
+
+-- !select_group_bit_or --
+50
+
+-- !select_group_bit_or2 --
+50
+
+-- !select_group_bit_or_n --
+100
+
+-- !select_group_bit_xor --
+50
+
+-- !select_group_bit_xor2 --
+50
+
+-- !select_group_bit_xor_n --
+100
+
+-- !select_group_bitmap_xor --
+\N
+
+-- !select_group_bitmap_xor2 --
+\N
+
+-- !select_group_bitmap_xor_n --
+\N
+
+-- !select_hll_union_agg --
+1
+
+-- !select_hll_union_agg2 --
+1
+
+-- !select_hll_union_agg_n --
+1
+
+-- !select_hll_union --
+\N
+
+-- !select_hll_union2 --
+\N
+
+-- !select_hll_union_n --
+\N
+
+-- !select_intersect_count --
+0
+
+-- !select_intersect_count2 --
+0
+
+-- !select_intersect_count_n --
+0
+
+-- !select_group_concat --
+non-null
+
+-- !select_group_concat2 --
+non-null
+
+-- !select_group_concat_n --
+text
+
+-- !select_multi_distinct_group_concat --
+non-null
+
+-- !select_multi_distinct_group_concat2 --
+non-null
+
+-- !select_multi_distinct_group_concat_n --
+text
+
+-- !select_multi_distinct_sum0 --
+50
+
+-- !select_multi_distinct_sum02 --
+50
+
+-- !select_multi_distinct_sum0_n --
+100
+
+-- !select_multi_distinct_sum --
+50
+
+-- !select_multi_distinct_sum2 --
+50
+
+-- !select_multi_distinct_sum_n --
+100
+
+-- !select_histogram --
+{"num_buckets":1,"buckets":[{"lower":"50","upper":"50","ndv":1,"count":1,"pre_sum":0}]}
+
+-- !select_histogram2 --
+{"num_buckets":1,"buckets":[{"lower":"50","upper":"50","ndv":1,"count":1,"pre_sum":0}]}
+
+-- !select_histogram_n --
+{"num_buckets":1,"buckets":[{"lower":"100","upper":"100","ndv":1,"count":1,"pre_sum":0}]}
+
+-- !select_max_by --
+50
+
+-- !select_max_by2 --
+50
+
+-- !select_max_by_n --
+100
+
+-- !select_min_by --
+50
+
+-- !select_min_by2 --
+50
+
+-- !select_min_by_n --
+100
+
+-- !select_multi_distinct_count --
+1
+
+-- !select_multi_distinct_count2 --
+1
+
+-- !select_multi_distinct_count_n --
+1
+
+-- !select_ndv --
+1
+
+-- !select_ndv2 --
+1
+
+-- !select_ndv_n --
+1
+
+-- !select_covar --
+0.0
+
+-- !select_covar2 --
+0.0
+
+-- !select_covar_n --
+0.0
+
+-- !select_covar_samp --
+0.0
+
+-- !select_covar_samp2 --
+0.0
+
+-- !select_covar_samp_n --
+0.0
+
+-- !select_percentile --
+5000.0
+
+-- !select_percentile2 --
+5000.0
+
+-- !select_percentile_n --
+1000.0
+
+-- !select_percentile_approx --
+5000.0
+
+-- !select_percentile_approx2 --
+5000.0
+
+-- !select_percentile_approx_n --
+1000.0
+
+-- !select_percentile_approx_weighted --
+50.0
+
+-- !select_percentile_approx_weighted2 --
+50.0
+
+-- !select_percentile_approx_weighted_n --
+100.0
+
+-- !select_sequence_count --
+0
+
+-- !select_sequence_count2 --
+0
+
+-- !select_sequence_count_n --
+0
+
+-- !select_sequence_match --
+false
+
+-- !select_sequence_match2 --
+false
+
+-- !select_sequence_match_n --
+false
+
+-- !select_stddev --
+0.0
+
+-- !select_stddev2 --
+0.0
+
+-- !select_stddev_n --
+0.0
+
+-- !select_stddev_pop --
+0.0
+
+-- !select_stddev_pop2 --
+0.0
+
+-- !select_stddev_pop_n --
+0.0
+
+-- !select_stddev_samp --
+0.0
+
+-- !select_stddev_samp2 --
+0.0
+
+-- !select_stddev_samp_n --
+0.0
+
+-- !select_sum0 --
+50
+
+-- !select_sum02 --
+50
+
+-- !select_sum0_n --
+100
+
+-- !select_topn --
+{"non-null":1}
+
+-- !select_topn2 --
+{"non-null":1}
+
+-- !select_topn_n --
+{"text":1}
+
+-- !select_topn_array --
+["non-null"]
+
+-- !select_topn_array2 --
+["non-null"]
+
+-- !select_topn_array_n --
+["text"]
+
+-- !select_topn_weighted --
+["non-null"]
+
+-- !select_topn_weighted2 --
+["non-null"]
+
+-- !select_topn_weighted_n --
+["text"]
+
+-- !select_variance --
+0.0
+
+-- !select_variance2 --
+0.0
+
+-- !select_variance_n --
+0.0
+
+-- !select_var_pop --
+0.0
+
+-- !select_var_pop2 --
+0.0
+
+-- !select_var_pop_n --
+0.0
+
+-- !select_variance_samp --
+0.0
+
+-- !select_variance_samp2 --
+0.0
+
+-- !select_variance_samp_n --
+0.0
+
+-- !select_var_samp --
+0.0
+
+-- !select_var_samp2 --
+0.0
+
+-- !select_var_samp_n --
+0.0
+
+-- !select_window_funnel --
+0
+
+-- !select_window_funnel2 --
+0
+
+-- !select_window_funnel_n --
+0
+
+-- !select_map_agg --
+{50:"non-null string"}
+
+-- !select_map_agg2 --
+{50:"non-null string"}
+
+-- !select_map_agg_n --
+{100:"string"}
+
+-- !select_array_agg --
+["non-null string"]
+
+-- !select_array_agg2 --
+["non-null string"]
+
+-- !select_array_agg_n --
+["string"]
+
+-- !select_retention --
+[0, 0]
+
+-- !select_retention2 --
+[0, 0]
+
+-- !select_retention_n --
+[0, 0]
+
diff --git a/regression-test/data/nereids_p0/sql_functions/window_functions/test_select_stddev_variance_window.out b/regression-test/data/nereids_p0/sql_functions/window_functions/test_select_stddev_variance_window.out
index 24fd821c9a7..cc19ecd6be6 100644
--- a/regression-test/data/nereids_p0/sql_functions/window_functions/test_select_stddev_variance_window.out
+++ b/regression-test/data/nereids_p0/sql_functions/window_functions/test_select_stddev_variance_window.out
@@ -121,9 +121,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 2.1213203435596424
-5 \N
+5 0.0
6 2.8284271247461903
7 2.5166114784235836
8 17770.84139820059
@@ -153,21 +153,21 @@
15 867.8342295623053
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 11759.932436232868
@@ -183,12 +183,12 @@
11 2.1213203435596424
12 32767.330742677226
13 23350.08012834217
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 2.1213203435596424
4 2.5166114784235836
5 2.8284271247461903
@@ -325,9 +325,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 4.5
-5 \N
+5 0.0
6 8.0
7 6.333333333333334
8 3.15802804E8
@@ -357,21 +357,21 @@
15 753136.25
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 1.382960109047619E8
@@ -387,12 +387,12 @@
11 4.5
12 1.073697964E9
13 5.45226242E8
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 4.5
4 6.333333333333334
5 8.0
@@ -529,9 +529,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 2.1213203435596424
-5 \N
+5 0.0
6 2.8284271247461903
7 2.5166114784235836
8 17770.84139820059
@@ -561,21 +561,21 @@
15 867.8342295623053
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 11759.932436232868
@@ -591,12 +591,12 @@
11 2.1213203435596424
12 32767.330742677226
13 23350.08012834217
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 2.1213203435596424
4 2.5166114784235836
5 2.8284271247461903
@@ -733,9 +733,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 4.5
-5 \N
+5 0.0
6 8.0
7 6.333333333333334
8 3.15802804E8
@@ -765,21 +765,21 @@
15 753136.25
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 1.382960109047619E8
@@ -795,12 +795,12 @@
11 4.5
12 1.073697964E9
13 5.45226242E8
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 4.5
4 6.333333333333334
5 8.0
diff --git a/regression-test/data/nereids_syntax_p0/mv/aggregate/agg_sync_mv.out b/regression-test/data/nereids_syntax_p0/mv/aggregate/agg_sync_mv.out
index d09c21a85e1..0cdfbc4a991 100644
--- a/regression-test/data/nereids_syntax_p0/mv/aggregate/agg_sync_mv.out
+++ b/regression-test/data/nereids_syntax_p0/mv/aggregate/agg_sync_mv.out
@@ -150,7 +150,7 @@
11 0.0
-- !select_percentile_array --
-\N \N
+\N []
0 [1, 1, 1]
1 [2, 2, 2]
2 [3, 3, 3]
@@ -165,7 +165,7 @@
11 [12, 12, 12]
-- !select_percentile_array_mv --
-\N \N
+\N []
0 [1, 1, 1]
1 [2, 2, 2]
2 [3, 3, 3]
@@ -780,7 +780,7 @@
11 12
-- !select_histogram --
-\N \N
+\N {"num_buckets":0,"buckets":[]}
0 {"num_buckets":1,"buckets":[{"lower":"1","upper":"1","ndv":1,"count":2,"pre_sum":0}]}
1 {"num_buckets":1,"buckets":[{"lower":"2","upper":"2","ndv":1,"count":2,"pre_sum":0}]}
2 {"num_buckets":1,"buckets":[{"lower":"3","upper":"3","ndv":1,"count":2,"pre_sum":0}]}
@@ -795,7 +795,7 @@
11 {"num_buckets":1,"buckets":[{"lower":"12","upper":"12","ndv":1,"count":2,"pre_sum":0}]}
-- !select_histogram_mv --
-\N \N
+\N {"num_buckets":0,"buckets":[]}
0 {"num_buckets":1,"buckets":[{"lower":"1","upper":"1","ndv":1,"count":2,"pre_sum":0}]}
1 {"num_buckets":1,"buckets":[{"lower":"2","upper":"2","ndv":1,"count":2,"pre_sum":0}]}
2 {"num_buckets":1,"buckets":[{"lower":"3","upper":"3","ndv":1,"count":2,"pre_sum":0}]}
@@ -1080,7 +1080,7 @@
11 0
-- !select_sequence_match --
-\N false
+\N \N
0 false
1 false
2 false
@@ -1095,7 +1095,7 @@
11 false
-- !select_sequence_match_mv --
-\N false
+\N \N
0 false
1 false
2 false
@@ -1440,7 +1440,7 @@
11 0.0
-- !select_window_funnel --
-\N 0
+\N \N
0 1
1 0
2 0
@@ -1455,7 +1455,7 @@
11 0
-- !select_window_funnel_mv --
-\N 0
+\N \N
0 1
1 0
2 0
@@ -1470,7 +1470,7 @@
11 0
-- !select_retention --
-\N [0, 0]
+\N \N
0 [0, 0]
1 [0, 0]
2 [0, 0]
@@ -1485,7 +1485,7 @@
11 [0, 0]
-- !select_retention_mv --
-\N [0, 0]
+\N \N
0 [0, 0]
1 [0, 0]
2 [0, 0]
diff --git a/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_all_functions2.out b/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_all_functions2.out
index 0d83f2238a9..f41a52f0ae0 100644
--- a/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_all_functions2.out
+++ b/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_all_functions2.out
@@ -45,7 +45,7 @@
5
-- !select_percentile_approx1 --
-\N
+0.0
-- !select_percentile_array --
[255, 1989, 1991]
diff --git a/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out b/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out
index d8542dca566..0da41c3f527 100644
--- a/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out
+++ b/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out
@@ -121,9 +121,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 2.1213203435596424
-5 \N
+5 0.0
6 2.8284271247461903
7 2.5166114784235836
8 17770.84139820059
@@ -153,21 +153,21 @@
15 867.8342295623053
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 11759.932436232868
@@ -183,12 +183,12 @@
11 2.1213203435596424
12 32767.330742677226
13 23350.08012834217
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 2.1213203435596424
4 2.5166114784235836
5 2.8284271247461903
@@ -325,9 +325,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 4.5
-5 \N
+5 0.0
6 8.0
7 6.333333333333334
8 3.15802804E8
@@ -357,21 +357,21 @@
15 753136.25
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 1.382960109047619E8
@@ -387,12 +387,12 @@
11 4.5
12 1.073697964E9
13 5.45226242E8
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 4.5
4 6.333333333333334
5 8.0
@@ -529,9 +529,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 2.1213203435596424
-5 \N
+5 0.0
6 2.8284271247461903
7 2.5166114784235836
8 17770.84139820059
@@ -561,21 +561,21 @@
15 867.8342295623053
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 11759.932436232868
@@ -591,12 +591,12 @@
11 2.1213203435596424
12 32767.330742677226
13 23350.08012834217
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 2.1213203435596424
4 2.5166114784235836
5 2.8284271247461903
@@ -733,9 +733,9 @@
-- !select_default --
1 \N
2 \N
-3 \N
+3 0.0
4 4.5
-5 \N
+5 0.0
6 8.0
7 6.333333333333334
8 3.15802804E8
@@ -765,21 +765,21 @@
15 753136.25
-- !select_default --
-1 \N
-2 \N
-3 \N
-4 \N
-5 \N
-6 \N
-7 \N
-8 \N
-9 \N
-10 \N
-11 \N
-12 \N
-13 \N
-14 \N
-15 \N
+1 0.0
+2 0.0
+3 0.0
+4 0.0
+5 0.0
+6 0.0
+7 0.0
+8 0.0
+9 0.0
+10 0.0
+11 0.0
+12 0.0
+13 0.0
+14 0.0
+15 0.0
-- !select_default --
1 1.382960109047619E8
@@ -795,12 +795,12 @@
11 4.5
12 1.073697964E9
13 5.45226242E8
-14 \N
-15 \N
+14 0.0
+15 0.0
-- !select_default --
-1 \N
-2 \N
+1 0.0
+2 0.0
3 4.5
4 6.333333333333334
5 8.0
diff --git a/regression-test/data/tpcds_sf1_p1/sql/q17.out b/regression-test/data/tpcds_sf1_p1/sql/q17.out
index eb02fc88450..46190ec806c 100644
--- a/regression-test/data/tpcds_sf1_p1/sql/q17.out
+++ b/regression-test/data/tpcds_sf1_p1/sql/q17.out
@@ -1,4 +1,4 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !q17 --
-AAAAAAAAKPFEAAAA Recently right TN 1 99.0 \N \N 1 66.0 \N \N 1 32.0 \N \N
+AAAAAAAAKPFEAAAA Recently right TN 1 99.0 0.0 0.0 1 66.0 0.0 0.0 1 32.0 0.0 0.0
diff --git a/regression-test/data/tpcds_sf1_unique_p1/sql/q17.out b/regression-test/data/tpcds_sf1_unique_p1/sql/q17.out
index eb02fc88450..33276ba6e54 100644
--- a/regression-test/data/tpcds_sf1_unique_p1/sql/q17.out
+++ b/regression-test/data/tpcds_sf1_unique_p1/sql/q17.out
@@ -1,4 +1,3 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !q17 --
-AAAAAAAAKPFEAAAA Recently right TN 1 99.0 \N \N 1 66.0 \N \N 1 32.0 \N \N
-
+AAAAAAAAKPFEAAAA Recently right TN 1 99.0 0.0 0.0 1 66.0 0.0 0.0 1 32.0 0.0 0.0
\ No newline at end of file
diff --git a/regression-test/suites/nereids_p0/aggregate/agg_nullable.groovy b/regression-test/suites/nereids_p0/aggregate/agg_nullable.groovy
new file mode 100644
index 00000000000..2b0b51cd64f
--- /dev/null
+++ b/regression-test/suites/nereids_p0/aggregate/agg_nullable.groovy
@@ -0,0 +1,1024 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("agg_nullable") {
+ sql "SET enable_nereids_planner=true"
+ sql "SET enable_fallback_to_original_planner=false"
+ sql "set disable_nereids_rules=PRUNE_EMPTY_PARTITION"
+ sql "drop table if exists agg_nullable_test"
+ sql """
+ CREATE TABLE IF NOT EXISTS `agg_nullable_test` (
+ `id` int null,
+ `kntint` tinyint(4) null,
+ `knint` int(11) null,
+ `knbint` bigint(20) null,
+ `kndbl` double null,
+ `knvchrs1` varchar(10) null,
+ `knstr` string null,
+ `kndtv2` datev2 null,
+ `kndtm` datetime null,
+ `knaint` array<int> null,
+ `knabint` array<bigint(20)> null,
+ `ktint` tinyint(4) not null,
+ `kint` int(11) not null,
+ `kbint` bigint(20) not null,
+ `kdbl` double not null,
+ `kvchrs1` varchar(10) not null,
+ `kstr` string not null,
+ `kdtv2` datev2 not null,
+ `kdtm` datetime not null,
+ `kaint` array<int> not null,
+ `kabint` array<bigint(20)> not null
+ ) engine=olap
+ DISTRIBUTED BY HASH(`id`) BUCKETS 4
+ properties("replication_num" = "1");
+ """
+
+ qt_select_any_value """select any_value(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select any_value(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_any_value2 """select any_value(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select any_value(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_any_value_n """select any_value(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select any_value(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_sum_foreach """select sum_foreach(kaint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sum_foreach(kaint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<BIGINT>, nullable=true"
+ }
+
+ qt_select_sum_foreach2 """select sum_foreach(kaint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select sum_foreach(kaint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<BIGINT>, nullable=true"
+ }
+
+ qt_select_sum_foreach_n """select sum_foreach(knaint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sum_foreach(knaint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<BIGINT>, nullable=true"
+ }
+
+ qt_select_approx_count_distinct """select approx_count_distinct(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select approx_count_distinct(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_approx_count_distinct2 """select approx_count_distinct(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select approx_count_distinct(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_approx_count_distinct_n """select approx_count_distinct(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select approx_count_distinct(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_collect_set """select collect_set(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select collect_set(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_set2 """select collect_set(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select collect_set(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_set_n """select collect_set(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select collect_set(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_list """select collect_list(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select collect_list(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_list2 """select collect_list(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select collect_list(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_list_n """select collect_list(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select collect_list(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_corr """select corr(kint, kbint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select corr(kint, kbint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_corr2 """select corr(kint, kbint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select corr(kint, kbint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_corr_n """select corr(knint, knbint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select corr(knint, knbint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_array """select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<DOUBLE>, nullable=false"
+ }
+
+ qt_select_percentile_array2 """select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<DOUBLE>, nullable=false"
+ }
+
+ qt_select_percentile_array_n """select percentile_array(knint, [0.5,0.55,0.805]) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile_array(knint, [0.5,0.55,0.805]) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<DOUBLE>, nullable=false"
+ }
+
+ qt_select_quantile_union """select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=QUANTILE_STATE, nullable=false"
+ }
+
+ qt_select_quantile_union2 """select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=QUANTILE_STATE, nullable=false"
+ }
+
+ qt_select_quantile_union_n """select quantile_union(to_quantile_state(knbint, 2048)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select quantile_union(to_quantile_state(knbint, 2048)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=QUANTILE_STATE, nullable=false"
+ }
+
+ qt_select_count_by_enum """select count_by_enum(kstr) from agg_nullable_test;"""
+ explain {
+ sql("verbose select count_by_enum(kstr) from agg_nullable_test;")
+ contains "colUniqueId=null, type=TEXT, nullable=false"
+ }
+
+ qt_select_count_by_enum2 """select count_by_enum(kstr) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select count_by_enum(kstr) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=TEXT, nullable=false"
+ }
+
+ qt_select_count_by_enum_n """select count_by_enum(knstr) from agg_nullable_test;"""
+ explain {
+ sql("verbose select count_by_enum(knstr) from agg_nullable_test;")
+ contains "colUniqueId=null, type=TEXT, nullable=false"
+ }
+
+ qt_select_avg_weighted """select avg_weighted(ktint, kdbl) from agg_nullable_test;"""
+ explain {
+ sql("verbose select avg_weighted(ktint, kdbl) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_avg_weighted2 """select avg_weighted(ktint, kdbl) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select avg_weighted(ktint, kdbl) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_avg_weighted_n """select avg_weighted(kntint, kndbl) from agg_nullable_test;"""
+ explain {
+ sql("verbose select avg_weighted(kntint, kndbl) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_bitmap_intersect """select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_intersect2 """select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_intersect_n """select bitmap_intersect(bitmap_hash(knbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_intersect(bitmap_hash(knbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_agg """select bitmap_agg(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_agg(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_agg2 """select bitmap_agg(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select bitmap_agg(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_agg_n """select bitmap_agg(kbint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_agg(kbint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union """select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union2 """select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union_n """select bitmap_union(bitmap_hash(knbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_union(bitmap_hash(knbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union_count """select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_count2 """select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_count_n """select bitmap_union_count(bitmap_hash(knbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_union_count(bitmap_hash(knbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_int """select bitmap_union_int(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_union_int(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_int2 """select bitmap_union_int(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select bitmap_union_int(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_int_n """select bitmap_union_int(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select bitmap_union_int(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_group_array_intersect """select group_array_intersect(kaint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_array_intersect(kaint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_group_array_intersect2 """select group_array_intersect(kaint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select group_array_intersect(kaint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_group_array_intersect_n """select group_array_intersect(knaint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_array_intersect(knaint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_group_bit_and """select group_bit_and(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bit_and(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_and2 """select group_bit_and(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select group_bit_and(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_group_bit_and_n """select group_bit_and(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bit_and(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_or """select group_bit_or(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bit_or(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_or2 """select group_bit_or(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select group_bit_or(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_group_bit_or_n """select group_bit_or(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bit_or(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_xor """select group_bit_xor(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bit_xor(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_xor2 """select group_bit_xor(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select group_bit_xor(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_group_bit_xor_n """select group_bit_xor(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bit_xor(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bitmap_xor """select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=true"
+ }
+
+ qt_select_group_bitmap_xor2 """select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_group_bitmap_xor_n """select group_bitmap_xor(bitmap_hash(knbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_bitmap_xor(bitmap_hash(knbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BITMAP, nullable=true"
+ }
+
+ qt_select_hll_union_agg """select hll_union_agg(hll_hash(kbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select hll_union_agg(hll_hash(kbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_hll_union_agg2 """select hll_union_agg(hll_hash(kbint)) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select hll_union_agg(hll_hash(kbint)) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_hll_union_agg_n """select hll_union_agg(hll_hash(knbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select hll_union_agg(hll_hash(knbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_hll_union """select hll_union(hll_hash(kbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select hll_union(hll_hash(kbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=HLL, nullable=false"
+ }
+
+ qt_select_hll_union2 """select hll_union(hll_hash(kbint)) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select hll_union(hll_hash(kbint)) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=HLL, nullable=false"
+ }
+
+ qt_select_hll_union_n """select hll_union(hll_hash(knbint)) from agg_nullable_test;"""
+ explain {
+ sql("verbose select hll_union(hll_hash(knbint)) from agg_nullable_test;")
+ contains "colUniqueId=null, type=HLL, nullable=false"
+ }
+
+ qt_select_intersect_count """select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test;"""
+ explain {
+ sql("verbose select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_intersect_count2 """select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_intersect_count_n """select intersect_count(bitmap_hash(knbint), knint, 3, 4) from agg_nullable_test;"""
+ explain {
+ sql("verbose select intersect_count(bitmap_hash(knbint), knint, 3, 4) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_group_concat """select group_concat(kvchrs1) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_concat(kvchrs1) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_group_concat2 """select group_concat(kvchrs1) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select group_concat(kvchrs1) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_group_concat_n """select group_concat(knvchrs1) from agg_nullable_test;"""
+ explain {
+ sql("verbose select group_concat(knvchrs1) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_multi_distinct_group_concat """select multi_distinct_group_concat(kvchrs1) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_group_concat(kvchrs1) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_multi_distinct_group_concat2 """select multi_distinct_group_concat(kvchrs1) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select multi_distinct_group_concat(kvchrs1) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_multi_distinct_group_concat_n """select multi_distinct_group_concat(knvchrs1) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_group_concat(knvchrs1) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_multi_distinct_sum0 """select multi_distinct_sum0(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_sum0(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum02 """select multi_distinct_sum0(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select multi_distinct_sum0(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum0_n """select multi_distinct_sum0(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_sum0(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum """select multi_distinct_sum(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_sum(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=true"
+ }
+
+ qt_select_multi_distinct_sum2 """select multi_distinct_sum(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select multi_distinct_sum(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum_n """select multi_distinct_sum(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_sum(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=true"
+ }
+
+ qt_select_histogram """select histogram(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select histogram(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_histogram2 """select histogram(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select histogram(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_histogram_n """select histogram(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select histogram(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_max_by """select max_by(kint, kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select max_by(kint, kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_max_by2 """select max_by(kint, kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select max_by(kint, kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_max_by_n """select max_by(knint, knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select max_by(knint, knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_min_by """select min_by(kint, kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select min_by(kint, kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_min_by2 """select min_by(kint, kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select min_by(kint, kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_min_by_n """select min_by(knint, knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select min_by(knint, knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_multi_distinct_count """select multi_distinct_count(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_count(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_count2 """select multi_distinct_count(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select multi_distinct_count(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_count_n """select multi_distinct_count(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select multi_distinct_count(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_ndv """select ndv(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select ndv(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_ndv2 """select ndv(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select ndv(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_ndv_n """select ndv(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select ndv(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_covar """select covar(kint, kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select covar(kint, kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_covar2 """select covar(kint, kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select covar(kint, kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_covar_n """select covar(knint, knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select covar(knint, knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_covar_samp """select covar_samp(kint, kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select covar_samp(kint, kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_covar_samp2 """select covar_samp(kint, kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select covar_samp(kint, kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_covar_samp_n """select covar_samp(knint, knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select covar_samp(knint, knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile """select percentile(kbint, 0.6) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile(kbint, 0.6) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile2 """select percentile(kbint, 0.6) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select percentile(kbint, 0.6) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_percentile_n """select percentile(knbint, 0.6) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile(knbint, 0.6) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx """select percentile_approx(kbint, 0.6) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile_approx(kbint, 0.6) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx2 """select percentile_approx(kbint, 0.6) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select percentile_approx(kbint, 0.6) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_percentile_approx_n """select percentile_approx(knbint, 0.6) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile_approx(knbint, 0.6) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx_weighted """select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx_weighted2 """select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_percentile_approx_weighted_n """select percentile_approx_weighted(knint, knbint, 0.6) from agg_nullable_test;"""
+ explain {
+ sql("verbose select percentile_approx_weighted(knint, knbint, 0.6) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_sequence_count """select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sequence_count2 """select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sequence_count_n """select sequence_count('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sequence_count('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sequence_match """select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BOOLEAN, nullable=true"
+ }
+
+ qt_select_sequence_match2 """select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BOOLEAN, nullable=false"
+ }
+
+ qt_select_sequence_match_n """select sequence_match('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sequence_match('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BOOLEAN, nullable=true"
+ }
+
+ qt_select_stddev """select stddev(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select stddev(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev2 """select stddev(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select stddev(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_stddev_n """select stddev(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select stddev(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_pop """select stddev_pop(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select stddev_pop(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_pop2 """select stddev_pop(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select stddev_pop(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_stddev_pop_n """select stddev_pop(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select stddev_pop(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_samp """select stddev_samp(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select stddev_samp(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_samp2 """select stddev_samp(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select stddev_samp(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_stddev_samp_n """select stddev_samp(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select stddev_samp(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_sum0 """select sum0(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sum0(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sum02 """select sum0(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select sum0(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sum0_n """select sum0(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select sum0(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_topn """select topn(kvchrs1, 3) from agg_nullable_test;"""
+ explain {
+ sql("verbose select topn(kvchrs1, 3) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_topn2 """select topn(kvchrs1, 3) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select topn(kvchrs1, 3) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_topn_n """select topn(knvchrs1, 3) from agg_nullable_test;"""
+ explain {
+ sql("verbose select topn(knvchrs1, 3) from agg_nullable_test;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_topn_array """select topn_array(kvchrs1, 3) from agg_nullable_test;"""
+ explain {
+ sql("verbose select topn_array(kvchrs1, 3) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<VARCHAR(10)>, nullable=true"
+ }
+
+ qt_select_topn_array2 """select topn_array(kvchrs1, 3) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select topn_array(kvchrs1, 3) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<VARCHAR(10)>, nullable=false"
+ }
+
+ qt_select_topn_array_n """select topn_array(knvchrs1, 3) from agg_nullable_test;"""
+ explain {
+ sql("verbose select topn_array(knvchrs1, 3) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<VARCHAR(10)>, nullable=true"
+ }
+
+ qt_select_topn_weighted """select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test;"""
+ explain {
+ sql("verbose select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<CHARACTER>, nullable=true"
+ }
+
+ qt_select_topn_weighted2 """select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<CHARACTER>, nullable=false"
+ }
+
+ qt_select_topn_weighted_n """select topn_weighted(knvchrs1, kntint, 3) from agg_nullable_test;"""
+ explain {
+ sql("verbose select topn_weighted(knvchrs1, kntint, 3) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<CHARACTER>, nullable=true"
+ }
+
+ qt_select_variance """select variance(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select variance(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_variance2 """select variance(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select variance(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_variance_n """select variance(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select variance(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_pop """select var_pop(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select var_pop(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_pop2 """select var_pop(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select var_pop(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_var_pop_n """select var_pop(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select var_pop(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_variance_samp """select variance_samp(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select variance_samp(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_variance_samp2 """select variance_samp(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select variance_samp(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_variance_samp_n """select variance_samp(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select variance_samp(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_samp """select var_samp(kint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select var_samp(kint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_samp2 """select var_samp(kint) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select var_samp(kint) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_var_samp_n """select var_samp(knint) from agg_nullable_test;"""
+ explain {
+ sql("verbose select var_samp(knint) from agg_nullable_test;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_window_funnel """select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test;"""
+ explain {
+ sql("verbose select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_window_funnel2 """select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_window_funnel_n """select window_funnel(3600 * 3, 'default', kndtm, knint = 1, knint = 2) from agg_nullable_test;"""
+ explain {
+ sql("verbose select window_funnel(3600 * 3, 'default', kndtm, knint = 1, knint = 2) from agg_nullable_test;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_map_agg """select map_agg(kint, kstr) from agg_nullable_test;"""
+ explain {
+ sql("verbose select map_agg(kint, kstr) from agg_nullable_test;")
+ contains "colUniqueId=null, type=MAP<INT,TEXT>, nullable=false"
+ }
+
+ qt_select_map_agg2 """select map_agg(kint, kstr) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select map_agg(kint, kstr) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=MAP<INT,TEXT>, nullable=false"
+ }
+
+ qt_select_map_agg_n """select map_agg(knint, knstr) from agg_nullable_test;"""
+ explain {
+ sql("verbose select map_agg(knint, knstr) from agg_nullable_test;")
+ contains "colUniqueId=null, type=MAP<INT,TEXT>, nullable=false"
+ }
+
+ qt_select_array_agg """select array_agg(kstr) from agg_nullable_test;"""
+ explain {
+ sql("verbose select array_agg(kstr) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<TEXT>, nullable=false"
+ }
+
+ qt_select_array_agg2 """select array_agg(kstr) from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select array_agg(kstr) from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<TEXT>, nullable=false"
+ }
+
+ qt_select_array_agg_n """select array_agg(knstr) from agg_nullable_test;"""
+ explain {
+ sql("verbose select array_agg(knstr) from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<TEXT>, nullable=false"
+ }
+
+ qt_select_retention """select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test;"""
+ explain {
+ sql("verbose select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<BOOLEAN>, nullable=true"
+ }
+
+ qt_select_retention2 """select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test group by id;"""
+ explain {
+ sql("verbose select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test group by id;")
+ contains "colUniqueId=null, type=ARRAY<BOOLEAN>, nullable=false"
+ }
+
+ qt_select_retention_n """select retention(kndtm = '2012-03-11', kndtm = '2012-03-12') from agg_nullable_test;"""
+ explain {
+ sql("verbose select retention(kndtm = '2012-03-11', kndtm = '2012-03-12') from agg_nullable_test;")
+ contains "colUniqueId=null, type=ARRAY<BOOLEAN>, nullable=true"
+ }
+}
diff --git a/regression-test/suites/nereids_p0/aggregate/agg_nullable_2.groovy b/regression-test/suites/nereids_p0/aggregate/agg_nullable_2.groovy
new file mode 100644
index 00000000000..7bf859b5552
--- /dev/null
+++ b/regression-test/suites/nereids_p0/aggregate/agg_nullable_2.groovy
@@ -0,0 +1,1036 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("agg_nullable_2") {
+ sql "SET enable_nereids_planner=true"
+ sql "SET enable_fallback_to_original_planner=false"
+ sql "set disable_nereids_rules=PRUNE_EMPTY_PARTITION"
+ sql "drop table if exists agg_nullable_test_2"
+ sql """
+ CREATE TABLE IF NOT EXISTS `agg_nullable_test_2` (
+ `id` int null,
+ `kntint` tinyint(4) null,
+ `knint` int(11) null,
+ `knbint` bigint(20) null,
+ `kndbl` double null,
+ `knvchrs1` varchar(10) null,
+ `knstr` string null,
+ `kndtv2` datev2 null,
+ `kndtm` datetime null,
+ `knaint` array<int> null,
+ `knabint` array<bigint(20)> null,
+ `ktint` tinyint(4) not null,
+ `kint` int(11) not null,
+ `kbint` bigint(20) not null,
+ `kdbl` double not null,
+ `kvchrs1` varchar(10) not null,
+ `kstr` string not null,
+ `kdtv2` datev2 not null,
+ `kdtm` datetime not null,
+ `kaint` array<int> not null,
+ `kabint` array<bigint(20)> not null
+ ) engine=olap
+ DISTRIBUTED BY HASH(`id`) BUCKETS 4
+ properties("replication_num" = "1");
+ """
+ sql """
+ INSERT INTO `agg_nullable_test_2` (
+ `id`, `kntint`, `knint`, `knbint`, `kndbl`, `knvchrs1`, `knstr`,
+ `kndtv2`, `kndtm`, `knaint`, `knabint`, `ktint`, `kint`, `kbint`,
+ `kdbl`, `kvchrs1`, `kstr`, `kdtv2`, `kdtm`, `kaint`, `kabint`
+ ) VALUES (
+ 1, 10, 100, 1000, 10.5, 'text', 'string',
+ '2023-01-01', '2023-01-01 12:00:00', [1, 2, 3], [1000, 2000], 5, 50, 5000,
+ 15.5, 'non-null', 'non-null string', '2023-02-01', '2023-02-01 14:00:00', [4, 5, 6], [3000, 4000]
+ );
+ """
+ sql """ select * from agg_nullable_test_2 order by 1;"""
+ qt_select_any_value """select any_value(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select any_value(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_any_value2 """select any_value(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select any_value(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_any_value_n """select any_value(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select any_value(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ // TODO: now foreach agg function have error, wait another PR fixed it
+ // qt_select_sum_foreach """select sum_foreach(kaint) from agg_nullable_test_2;"""
+ // explain {
+ // sql("verbose select sum_foreach(kaint) from agg_nullable_test_2;")
+ // contains "colUniqueId=null, type=ARRAY<BIGINT>, nullable=true"
+ // }
+
+ // qt_select_sum_foreach2 """select sum_foreach(kaint) from agg_nullable_test_2 group by id;"""
+ // explain {
+ // sql("verbose select sum_foreach(kaint) from agg_nullable_test_2 group by id;")
+ // contains "colUniqueId=null, type=ARRAY<BIGINT>, nullable=true"
+ // }
+
+ // qt_select_sum_foreach_n """select sum_foreach(knaint) from agg_nullable_test_2;"""
+ // explain {
+ // sql("verbose select sum_foreach(knaint) from agg_nullable_test_2;")
+ // contains "colUniqueId=null, type=ARRAY<BIGINT>, nullable=true"
+ // }
+
+ qt_select_approx_count_distinct """select approx_count_distinct(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select approx_count_distinct(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_approx_count_distinct2 """select approx_count_distinct(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select approx_count_distinct(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_approx_count_distinct_n """select approx_count_distinct(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select approx_count_distinct(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_collect_set """select collect_set(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select collect_set(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_set2 """select collect_set(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select collect_set(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_set_n """select collect_set(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select collect_set(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_list """select collect_list(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select collect_list(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_list2 """select collect_list(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select collect_list(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_collect_list_n """select collect_list(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select collect_list(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_corr """select corr(kint, kbint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select corr(kint, kbint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_corr2 """select corr(kint, kbint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select corr(kint, kbint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_corr_n """select corr(knint, knbint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select corr(knint, knbint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_array """select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<DOUBLE>, nullable=false"
+ }
+
+ qt_select_percentile_array2 """select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select percentile_array(kint, [0.5,0.55,0.805]) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<DOUBLE>, nullable=false"
+ }
+
+ qt_select_percentile_array_n """select percentile_array(knint, [0.5,0.55,0.805]) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile_array(knint, [0.5,0.55,0.805]) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<DOUBLE>, nullable=false"
+ }
+
+ qt_select_quantile_union """select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=QUANTILE_STATE, nullable=false"
+ }
+
+ qt_select_quantile_union2 """select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select quantile_union(to_quantile_state(kbint, 2048)) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=QUANTILE_STATE, nullable=false"
+ }
+
+ qt_select_quantile_union_n """select quantile_union(to_quantile_state(knbint, 2048)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select quantile_union(to_quantile_state(knbint, 2048)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=QUANTILE_STATE, nullable=false"
+ }
+
+ qt_select_count_by_enum """select count_by_enum(kstr) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select count_by_enum(kstr) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=TEXT, nullable=false"
+ }
+
+ qt_select_count_by_enum2 """select count_by_enum(kstr) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select count_by_enum(kstr) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=TEXT, nullable=false"
+ }
+
+ qt_select_count_by_enum_n """select count_by_enum(knstr) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select count_by_enum(knstr) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=TEXT, nullable=false"
+ }
+
+ qt_select_avg_weighted """select avg_weighted(ktint, kdbl) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select avg_weighted(ktint, kdbl) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_avg_weighted2 """select avg_weighted(ktint, kdbl) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select avg_weighted(ktint, kdbl) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_avg_weighted_n """select avg_weighted(kntint, kndbl) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select avg_weighted(kntint, kndbl) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_bitmap_intersect """select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_intersect2 """select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select bitmap_intersect(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_intersect_n """select bitmap_intersect(bitmap_hash(knbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_intersect(bitmap_hash(knbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_agg """select bitmap_agg(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_agg(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_agg2 """select bitmap_agg(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select bitmap_agg(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_agg_n """select bitmap_agg(kbint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_agg(kbint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union """select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union2 """select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select bitmap_union(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union_n """select bitmap_union(bitmap_hash(knbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_union(bitmap_hash(knbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_bitmap_union_count """select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_count2 """select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select bitmap_union_count(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_count_n """select bitmap_union_count(bitmap_hash(knbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_union_count(bitmap_hash(knbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_int """select bitmap_union_int(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_union_int(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_int2 """select bitmap_union_int(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select bitmap_union_int(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_bitmap_union_int_n """select bitmap_union_int(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select bitmap_union_int(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_group_array_intersect """select group_array_intersect(kaint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_array_intersect(kaint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_group_array_intersect2 """select group_array_intersect(kaint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select group_array_intersect(kaint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_group_array_intersect_n """select group_array_intersect(knaint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_array_intersect(knaint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<INT>, nullable=false"
+ }
+
+ qt_select_group_bit_and """select group_bit_and(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bit_and(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_and2 """select group_bit_and(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select group_bit_and(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_group_bit_and_n """select group_bit_and(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bit_and(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_or """select group_bit_or(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bit_or(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_or2 """select group_bit_or(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select group_bit_or(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_group_bit_or_n """select group_bit_or(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bit_or(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_xor """select group_bit_xor(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bit_xor(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bit_xor2 """select group_bit_xor(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select group_bit_xor(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_group_bit_xor_n """select group_bit_xor(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bit_xor(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_group_bitmap_xor """select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=true"
+ }
+
+ qt_select_group_bitmap_xor2 """select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select group_bitmap_xor(bitmap_hash(kbint)) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BITMAP, nullable=false"
+ }
+
+ qt_select_group_bitmap_xor_n """select group_bitmap_xor(bitmap_hash(knbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_bitmap_xor(bitmap_hash(knbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BITMAP, nullable=true"
+ }
+
+ qt_select_hll_union_agg """select hll_union_agg(hll_hash(kbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select hll_union_agg(hll_hash(kbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_hll_union_agg2 """select hll_union_agg(hll_hash(kbint)) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select hll_union_agg(hll_hash(kbint)) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_hll_union_agg_n """select hll_union_agg(hll_hash(knbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select hll_union_agg(hll_hash(knbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_hll_union """select hll_union(hll_hash(kbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select hll_union(hll_hash(kbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=HLL, nullable=false"
+ }
+
+ qt_select_hll_union2 """select hll_union(hll_hash(kbint)) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select hll_union(hll_hash(kbint)) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=HLL, nullable=false"
+ }
+
+ qt_select_hll_union_n """select hll_union(hll_hash(knbint)) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select hll_union(hll_hash(knbint)) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=HLL, nullable=false"
+ }
+
+ qt_select_intersect_count """select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_intersect_count2 """select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select intersect_count(bitmap_hash(kbint), kint, 3, 4) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_intersect_count_n """select intersect_count(bitmap_hash(knbint), knint, 3, 4) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select intersect_count(bitmap_hash(knbint), knint, 3, 4) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_group_concat """select group_concat(kvchrs1) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_concat(kvchrs1) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_group_concat2 """select group_concat(kvchrs1) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select group_concat(kvchrs1) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_group_concat_n """select group_concat(knvchrs1) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select group_concat(knvchrs1) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_multi_distinct_group_concat """select multi_distinct_group_concat(kvchrs1) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_group_concat(kvchrs1) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_multi_distinct_group_concat2 """select multi_distinct_group_concat(kvchrs1) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select multi_distinct_group_concat(kvchrs1) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_multi_distinct_group_concat_n """select multi_distinct_group_concat(knvchrs1) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_group_concat(knvchrs1) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_multi_distinct_sum0 """select multi_distinct_sum0(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_sum0(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum02 """select multi_distinct_sum0(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select multi_distinct_sum0(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum0_n """select multi_distinct_sum0(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_sum0(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum """select multi_distinct_sum(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_sum(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=true"
+ }
+
+ qt_select_multi_distinct_sum2 """select multi_distinct_sum(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select multi_distinct_sum(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_sum_n """select multi_distinct_sum(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_sum(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=true"
+ }
+
+ qt_select_histogram """select histogram(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select histogram(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_histogram2 """select histogram(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select histogram(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_histogram_n """select histogram(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select histogram(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_max_by """select max_by(kint, kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select max_by(kint, kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_max_by2 """select max_by(kint, kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select max_by(kint, kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_max_by_n """select max_by(knint, knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select max_by(knint, knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_min_by """select min_by(kint, kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select min_by(kint, kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_min_by2 """select min_by(kint, kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select min_by(kint, kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_min_by_n """select min_by(knint, knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select min_by(knint, knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_multi_distinct_count """select multi_distinct_count(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_count(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_count2 """select multi_distinct_count(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select multi_distinct_count(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_multi_distinct_count_n """select multi_distinct_count(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select multi_distinct_count(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_ndv """select ndv(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select ndv(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_ndv2 """select ndv(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select ndv(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_ndv_n """select ndv(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select ndv(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_covar """select covar(kint, kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select covar(kint, kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_covar2 """select covar(kint, kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select covar(kint, kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_covar_n """select covar(knint, knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select covar(knint, knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_covar_samp """select covar_samp(kint, kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select covar_samp(kint, kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_covar_samp2 """select covar_samp(kint, kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select covar_samp(kint, kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_covar_samp_n """select covar_samp(knint, knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select covar_samp(knint, knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile """select percentile(kbint, 0.6) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile(kbint, 0.6) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile2 """select percentile(kbint, 0.6) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select percentile(kbint, 0.6) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_percentile_n """select percentile(knbint, 0.6) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile(knbint, 0.6) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx """select percentile_approx(kbint, 0.6) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile_approx(kbint, 0.6) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx2 """select percentile_approx(kbint, 0.6) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select percentile_approx(kbint, 0.6) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_percentile_approx_n """select percentile_approx(knbint, 0.6) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile_approx(knbint, 0.6) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx_weighted """select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_percentile_approx_weighted2 """select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select percentile_approx_weighted(kint, kbint, 0.6) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_percentile_approx_weighted_n """select percentile_approx_weighted(knint, knbint, 0.6) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select percentile_approx_weighted(knint, knbint, 0.6) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_sequence_count """select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sequence_count2 """select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select sequence_count('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sequence_count_n """select sequence_count('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select sequence_count('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sequence_match """select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BOOLEAN, nullable=true"
+ }
+
+ qt_select_sequence_match2 """select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select sequence_match('(?1)(?2)', kdtv2, kint = 1, kint = 2) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BOOLEAN, nullable=false"
+ }
+
+ qt_select_sequence_match_n """select sequence_match('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select sequence_match('(?1)(?2)', kndtv2, knint = 1, knint = 2) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BOOLEAN, nullable=true"
+ }
+
+ qt_select_stddev """select stddev(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select stddev(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev2 """select stddev(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select stddev(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_stddev_n """select stddev(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select stddev(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_pop """select stddev_pop(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select stddev_pop(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_pop2 """select stddev_pop(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select stddev_pop(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_stddev_pop_n """select stddev_pop(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select stddev_pop(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_samp """select stddev_samp(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select stddev_samp(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_stddev_samp2 """select stddev_samp(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select stddev_samp(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_stddev_samp_n """select stddev_samp(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select stddev_samp(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_sum0 """select sum0(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select sum0(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sum02 """select sum0(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select sum0(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_sum0_n """select sum0(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select sum0(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=BIGINT, nullable=false"
+ }
+
+ qt_select_topn """select topn(kvchrs1, 3) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select topn(kvchrs1, 3) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_topn2 """select topn(kvchrs1, 3) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select topn(kvchrs1, 3) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=false"
+ }
+
+ qt_select_topn_n """select topn(knvchrs1, 3) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select topn(knvchrs1, 3) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=VARCHAR(65533), nullable=true"
+ }
+
+ qt_select_topn_array """select topn_array(kvchrs1, 3) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select topn_array(kvchrs1, 3) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<VARCHAR(10)>, nullable=true"
+ }
+
+ qt_select_topn_array2 """select topn_array(kvchrs1, 3) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select topn_array(kvchrs1, 3) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<VARCHAR(10)>, nullable=false"
+ }
+
+ qt_select_topn_array_n """select topn_array(knvchrs1, 3) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select topn_array(knvchrs1, 3) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<VARCHAR(10)>, nullable=true"
+ }
+
+ qt_select_topn_weighted """select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<CHARACTER>, nullable=true"
+ }
+
+ qt_select_topn_weighted2 """select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select topn_weighted(kvchrs1, ktint, 3) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<CHARACTER>, nullable=false"
+ }
+
+ qt_select_topn_weighted_n """select topn_weighted(knvchrs1, kntint, 3) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select topn_weighted(knvchrs1, kntint, 3) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<CHARACTER>, nullable=true"
+ }
+
+ qt_select_variance """select variance(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select variance(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_variance2 """select variance(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select variance(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_variance_n """select variance(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select variance(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_pop """select var_pop(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select var_pop(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_pop2 """select var_pop(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select var_pop(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_var_pop_n """select var_pop(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select var_pop(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_variance_samp """select variance_samp(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select variance_samp(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_variance_samp2 """select variance_samp(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select variance_samp(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_variance_samp_n """select variance_samp(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select variance_samp(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_samp """select var_samp(kint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select var_samp(kint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_var_samp2 """select var_samp(kint) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select var_samp(kint) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=false"
+ }
+
+ qt_select_var_samp_n """select var_samp(knint) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select var_samp(knint) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=DOUBLE, nullable=true"
+ }
+
+ qt_select_window_funnel """select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_window_funnel2 """select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select window_funnel(3600 * 3, 'default', kdtm, kint = 1, kint = 2) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=INT, nullable=false"
+ }
+
+ qt_select_window_funnel_n """select window_funnel(3600 * 3, 'default', kndtm, knint = 1, knint = 2) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select window_funnel(3600 * 3, 'default', kndtm, knint = 1, knint = 2) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=INT, nullable=true"
+ }
+
+ qt_select_map_agg """select map_agg(kint, kstr) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select map_agg(kint, kstr) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=MAP<INT,TEXT>, nullable=false"
+ }
+
+ qt_select_map_agg2 """select map_agg(kint, kstr) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select map_agg(kint, kstr) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=MAP<INT,TEXT>, nullable=false"
+ }
+
+ qt_select_map_agg_n """select map_agg(knint, knstr) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select map_agg(knint, knstr) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=MAP<INT,TEXT>, nullable=false"
+ }
+
+ qt_select_array_agg """select array_agg(kstr) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select array_agg(kstr) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<TEXT>, nullable=false"
+ }
+
+ qt_select_array_agg2 """select array_agg(kstr) from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select array_agg(kstr) from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<TEXT>, nullable=false"
+ }
+
+ qt_select_array_agg_n """select array_agg(knstr) from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select array_agg(knstr) from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<TEXT>, nullable=false"
+ }
+
+ qt_select_retention """select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<BOOLEAN>, nullable=true"
+ }
+
+ qt_select_retention2 """select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test_2 group by id;"""
+ explain {
+ sql("verbose select retention(kdtm = '2012-03-11', kdtm = '2012-03-12') from agg_nullable_test_2 group by id;")
+ contains "colUniqueId=null, type=ARRAY<BOOLEAN>, nullable=false"
+ }
+
+ qt_select_retention_n """select retention(kndtm = '2012-03-11', kndtm = '2012-03-12') from agg_nullable_test_2;"""
+ explain {
+ sql("verbose select retention(kndtm = '2012-03-11', kndtm = '2012-03-12') from agg_nullable_test_2;")
+ contains "colUniqueId=null, type=ARRAY<BOOLEAN>, nullable=true"
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org