diff --git a/be/src/vec/aggregate_functions/aggregate_function_window.h b/be/src/vec/aggregate_functions/aggregate_function_window.h index 95fedc3e13bbb7c..2a9bebfd112aded 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_window.h +++ b/be/src/vec/aggregate_functions/aggregate_function_window.h @@ -183,12 +183,12 @@ struct CopiedValue : public Value { std::string _copied_value; }; -template +template struct LeadAndLagData { public: bool has_init() const { return _is_init; } - static constexpr bool nullable = is_nullable; + static constexpr bool nullable = result_is_nullable; void set_null_if_need() { if (!_has_value) { @@ -204,7 +204,7 @@ struct LeadAndLagData { } void insert_result_into(IColumn& to) const { - if constexpr (is_nullable) { + if constexpr (result_is_nullable) { if (_data_value.is_null()) { auto& col = assert_cast(to); col.insert_default(); @@ -231,7 +231,7 @@ struct LeadAndLagData { } void set_value(const IColumn** columns, int64_t pos) { - if constexpr (is_nullable) { + if (is_column_nullable(*columns[0])) { const auto* nullable_column = assert_cast(columns[0]); if (nullable_column && nullable_column->is_null_at(pos)) { _data_value.set_null(true); @@ -501,7 +501,7 @@ class WindowFunctionData final }; template