This is an automated email from the ASF dual-hosted git repository.
lihaopeng 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 f9df3bae613 [Enhancement](functions) change some nullable mode and
clear some smooth upgrade (#25334)
f9df3bae613 is described below
commit f9df3bae6132e365140b43a580f26fd064fb4d38
Author: zclllyybb <[email protected]>
AuthorDate: Mon Oct 16 19:50:17 2023 +0800
[Enhancement](functions) change some nullable mode and clear some smooth
upgrade (#25334)
---
be/src/agent/be_exec_version_manager.h | 4 +-
.../aggregate_function_count_old.cpp | 51 ----
.../aggregate_function_count_old.h | 280 ---------------------
.../aggregate_function_simple_factory.cpp | 4 -
.../aggregate_function_sum_old.cpp | 33 ---
.../aggregate_function_sum_old.h | 201 ---------------
.../vec/functions/array/function_array_index.cpp | 4 +
be/src/vec/functions/array/function_array_index.h | 37 ++-
.../function_date_or_datetime_computation.cpp | 6 -
.../function_date_or_datetime_computation.h | 2 -
.../function_date_or_datetime_computation_v2.cpp | 7 -
be/src/vec/functions/function_map.cpp | 13 +-
be/src/vec/functions/function_string.cpp | 6 +-
be/src/vec/functions/function_string.h | 59 +----
be/src/vec/functions/simple_function_factory.h | 14 +-
be/src/vec/functions/time_of_function.cpp | 45 ----
be/src/vec/functions/to_time_function.cpp | 62 -----
.../main/java/org/apache/doris/analysis/Expr.java | 6 +
.../functions/scalar/ArrayContains.java | 8 +-
.../functions/scalar/ArrayPosition.java | 8 +-
.../expressions/functions/scalar/CountEqual.java | 8 +-
.../functions/scalar/MapContainsKey.java | 8 +-
.../functions/scalar/MapContainsValue.java | 8 +-
gensrc/script/doris_builtins_functions.py | 114 ++++-----
24 files changed, 153 insertions(+), 835 deletions(-)
diff --git a/be/src/agent/be_exec_version_manager.h
b/be/src/agent/be_exec_version_manager.h
index 25de399df3e..03d6b2ec6a5 100644
--- a/be/src/agent/be_exec_version_manager.h
+++ b/be/src/agent/be_exec_version_manager.h
@@ -59,7 +59,9 @@ private:
* d. elt function return type change to nullable(string)
* e. add repeat_max_num in repeat function
* 3: start from doris 2.1
- * a. aggregation function do not serialize bitmap to string
+ * a. aggregation function do not serialize bitmap to string.
+ * b. array contains/position/countequal function return nullable in less
situations.
+ * c. cleared old version of Version 2.
*/
inline const int BeExecVersionManager::max_be_exec_version = 3;
inline const int BeExecVersionManager::min_be_exec_version = 0;
diff --git a/be/src/vec/aggregate_functions/aggregate_function_count_old.cpp
b/be/src/vec/aggregate_functions/aggregate_function_count_old.cpp
deleted file mode 100644
index c480c09a5a4..00000000000
--- a/be/src/vec/aggregate_functions/aggregate_function_count_old.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// 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.
-// This file is copied from
-//
https://github.com/ClickHouse/ClickHouse/blob/master/src/AggregateFunctions/AggregateFunctionCount.cpp
-// and modified by Doris
-
-#include "vec/aggregate_functions/aggregate_function_count_old.h"
-
-#include <string>
-
-#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
-#include "vec/aggregate_functions/factory_helpers.h"
-
-namespace doris::vectorized {
-
-AggregateFunctionPtr create_aggregate_function_count_old(const std::string&
name,
- const DataTypes&
argument_types,
- const bool
result_is_nullable) {
- assert_arity_at_most<1>(name, argument_types);
-
- return std::make_shared<AggregateFunctionCountOld>(argument_types);
-}
-
-AggregateFunctionPtr create_aggregate_function_count_not_null_unary_old(
- const std::string& name, const DataTypes& argument_types, const bool
result_is_nullable) {
- assert_arity_at_most<1>(name, argument_types);
-
- return
std::make_shared<AggregateFunctionCountNotNullUnaryOld>(argument_types);
-}
-
-void register_aggregate_function_count_old(AggregateFunctionSimpleFactory&
factory) {
- factory.register_alternative_function("count",
create_aggregate_function_count_old, false);
- factory.register_alternative_function("count",
-
create_aggregate_function_count_not_null_unary_old, true);
-}
-
-} // namespace doris::vectorized
diff --git a/be/src/vec/aggregate_functions/aggregate_function_count_old.h
b/be/src/vec/aggregate_functions/aggregate_function_count_old.h
deleted file mode 100644
index 9a191bfd646..00000000000
--- a/be/src/vec/aggregate_functions/aggregate_function_count_old.h
+++ /dev/null
@@ -1,280 +0,0 @@
-// 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.
-// This file is copied from
-//
https://github.com/ClickHouse/ClickHouse/blob/master/src/AggregateFunctions/AggregateFunctionCountOld.h
-// and modified by Doris
-
-#pragma once
-
-#include <stddef.h>
-
-#include <algorithm>
-#include <boost/iterator/iterator_facade.hpp>
-#include <memory>
-#include <vector>
-
-#include "vec/aggregate_functions/aggregate_function.h"
-#include "vec/columns/column.h"
-#include "vec/columns/column_nullable.h"
-#include "vec/columns/column_vector.h"
-#include "vec/columns/columns_number.h"
-#include "vec/common/assert_cast.h"
-#include "vec/core/types.h"
-#include "vec/data_types/data_type.h"
-#include "vec/data_types/data_type_number.h"
-#include "vec/io/var_int.h"
-
-namespace doris {
-namespace vectorized {
-class Arena;
-class BufferReadable;
-class BufferWritable;
-} // namespace vectorized
-} // namespace doris
-
-/*
- * this function is used to solve agg of sum/count is not compatibility during
the upgrade process.
- * in PR #20370 have changed the serialize type and serialize column.
- * before is ColumnVector, now sum/count change to use ColumnFixedLengthObject.
- * so during the upgrade process, will be not compatible if exist old BE and
Newer BE.
- */
-
-namespace doris::vectorized {
-struct AggregateFunctionCountDataOld {
- UInt64 count = 0;
-};
-/// Simply count number of calls.
-class AggregateFunctionCountOld final
- : public IAggregateFunctionDataHelper<AggregateFunctionCountDataOld,
- AggregateFunctionCountOld> {
-public:
- AggregateFunctionCountOld(const DataTypes& argument_types_)
- : IAggregateFunctionDataHelper(argument_types_) {}
-
- String get_name() const override { return "count"; }
-
- DataTypePtr get_return_type() const override { return
std::make_shared<DataTypeInt64>(); }
-
- void add(AggregateDataPtr __restrict place, const IColumn**, size_t,
Arena*) const override {
- ++data(place).count;
- }
-
- void reset(AggregateDataPtr place) const override {
- AggregateFunctionCountOld::data(place).count = 0;
- }
-
- void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs,
- Arena*) const override {
- data(place).count += data(rhs).count;
- }
-
- void serialize(ConstAggregateDataPtr __restrict place, BufferWritable&
buf) const override {
- write_var_uint(data(place).count, buf);
- }
-
- void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf,
- Arena*) const override {
- read_var_uint(data(place).count, buf);
- }
-
- void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn&
to) const override {
- assert_cast<ColumnInt64&>(to).get_data().push_back(data(place).count);
- }
-
- void deserialize_from_column(AggregateDataPtr places, const IColumn&
column, Arena* arena,
- size_t num_rows) const override {
- auto data = assert_cast<const ColumnUInt64&>(column).get_data().data();
- auto* dst_data = reinterpret_cast<Data*>(places);
- for (size_t i = 0; i != num_rows; ++i) {
- dst_data[i].count = data[i];
- }
- }
-
- void serialize_to_column(const std::vector<AggregateDataPtr>& places,
size_t offset,
- MutableColumnPtr& dst, const size_t num_rows)
const override {
- auto& col = assert_cast<ColumnUInt64&>(*dst);
- col.resize(num_rows);
- auto* data = col.get_data().data();
- for (size_t i = 0; i != num_rows; ++i) {
- data[i] = AggregateFunctionCountOld::data(places[i] +
offset).count;
- }
- }
-
- void streaming_agg_serialize_to_column(const IColumn** columns,
MutableColumnPtr& dst,
- const size_t num_rows, Arena*
arena) const override {
- auto& col = assert_cast<ColumnUInt64&>(*dst);
- col.resize(num_rows);
- col.get_data().assign(num_rows, assert_cast<UInt64>(1UL));
- }
-
- void deserialize_and_merge_from_column(AggregateDataPtr __restrict place,
const IColumn& column,
- Arena* arena) const override {
- auto data = assert_cast<const ColumnUInt64&>(column).get_data().data();
- const size_t num_rows = column.size();
- for (size_t i = 0; i != num_rows; ++i) {
- AggregateFunctionCountOld::data(place).count += data[i];
- }
- }
-
- void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t
offset,
- AggregateDataPtr rhs, const ColumnString*
column, Arena* arena,
- const size_t num_rows) const override {
- this->deserialize_from_column(rhs, *column, arena, num_rows);
- DEFER({ this->destroy_vec(rhs, num_rows); });
- this->merge_vec(places, offset, rhs, arena, num_rows);
- }
-
- void deserialize_and_merge_vec_selected(const AggregateDataPtr* places,
size_t offset,
- AggregateDataPtr rhs, const
ColumnString* column,
- Arena* arena, const size_t
num_rows) const override {
- this->deserialize_from_column(rhs, *column, arena, num_rows);
- DEFER({ this->destroy_vec(rhs, num_rows); });
- this->merge_vec_selected(places, offset, rhs, arena, num_rows);
- }
-
- void serialize_without_key_to_column(ConstAggregateDataPtr __restrict
place,
- IColumn& to) const override {
- auto& col = assert_cast<ColumnUInt64&>(to);
- col.resize(1);
- reinterpret_cast<Data*>(col.get_data().data())->count =
- AggregateFunctionCountOld::data(place).count;
- }
-
- MutableColumnPtr create_serialize_column() const override {
- return ColumnVector<UInt64>::create();
- }
-
- DataTypePtr get_serialized_type() const override { return
std::make_shared<DataTypeUInt64>(); }
-};
-
-// TODO: Maybe AggregateFunctionCountNotNullUnaryOld should be a subclass of
AggregateFunctionCountOld
-// Simply count number of not-NULL values.
-class AggregateFunctionCountNotNullUnaryOld final
- : public IAggregateFunctionDataHelper<AggregateFunctionCountDataOld,
-
AggregateFunctionCountNotNullUnaryOld> {
-public:
- AggregateFunctionCountNotNullUnaryOld(const DataTypes& argument_types_)
- : IAggregateFunctionDataHelper(argument_types_) {}
-
- String get_name() const override { return "count"; }
-
- DataTypePtr get_return_type() const override { return
std::make_shared<DataTypeInt64>(); }
-
- void add(AggregateDataPtr __restrict place, const IColumn** columns,
size_t row_num,
- Arena*) const override {
- data(place).count += !assert_cast<const
ColumnNullable&>(*columns[0]).is_null_at(row_num);
- }
-
- void reset(AggregateDataPtr place) const override { data(place).count = 0;
}
-
- void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs,
- Arena*) const override {
- data(place).count += data(rhs).count;
- }
-
- void serialize(ConstAggregateDataPtr __restrict place, BufferWritable&
buf) const override {
- write_var_uint(data(place).count, buf);
- }
-
- void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf,
- Arena*) const override {
- read_var_uint(data(place).count, buf);
- }
-
- void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn&
to) const override {
- if (to.is_nullable()) {
- auto& null_column = assert_cast<ColumnNullable&>(to);
- null_column.get_null_map_data().push_back(0);
- assert_cast<ColumnInt64&>(null_column.get_nested_column())
- .get_data()
- .push_back(data(place).count);
- } else {
-
assert_cast<ColumnInt64&>(to).get_data().push_back(data(place).count);
- }
- }
-
- void deserialize_from_column(AggregateDataPtr places, const IColumn&
column, Arena* arena,
- size_t num_rows) const override {
- auto data = assert_cast<const ColumnUInt64&>(column).get_data().data();
- auto* dst_data = reinterpret_cast<Data*>(places);
- for (size_t i = 0; i != num_rows; ++i) {
- dst_data[i].count = data[i];
- }
- }
-
- void serialize_to_column(const std::vector<AggregateDataPtr>& places,
size_t offset,
- MutableColumnPtr& dst, const size_t num_rows)
const override {
- auto& col = assert_cast<ColumnUInt64&>(*dst);
- col.resize(num_rows);
- auto* data = col.get_data().data();
- for (size_t i = 0; i != num_rows; ++i) {
- data[i] = AggregateFunctionCountNotNullUnaryOld::data(places[i] +
offset).count;
- }
- }
-
- void streaming_agg_serialize_to_column(const IColumn** columns,
MutableColumnPtr& dst,
- const size_t num_rows, Arena*
arena) const override {
- auto& col = assert_cast<ColumnUInt64&>(*dst);
- col.resize(num_rows);
- auto& data = col.get_data();
- const ColumnNullable& input_col = assert_cast<const
ColumnNullable&>(*columns[0]);
- for (size_t i = 0; i < num_rows; i++) {
- data[i] = !input_col.is_null_at(i);
- }
- }
-
- void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t
offset,
- AggregateDataPtr rhs, const ColumnString*
column, Arena* arena,
- const size_t num_rows) const override {
- this->deserialize_from_column(rhs, *column, arena, num_rows);
- DEFER({ this->destroy_vec(rhs, num_rows); });
- this->merge_vec(places, offset, rhs, arena, num_rows);
- }
-
- void deserialize_and_merge_vec_selected(const AggregateDataPtr* places,
size_t offset,
- AggregateDataPtr rhs, const
ColumnString* column,
- Arena* arena, const size_t
num_rows) const override {
- this->deserialize_from_column(rhs, *column, arena, num_rows);
- DEFER({ this->destroy_vec(rhs, num_rows); });
- this->merge_vec_selected(places, offset, rhs, arena, num_rows);
- }
-
- void deserialize_and_merge_from_column(AggregateDataPtr __restrict place,
const IColumn& column,
- Arena* arena) const override {
- auto data = assert_cast<const ColumnUInt64&>(column).get_data().data();
- const size_t num_rows = column.size();
- for (size_t i = 0; i != num_rows; ++i) {
- AggregateFunctionCountNotNullUnaryOld::data(place).count +=
data[i];
- }
- }
-
- void serialize_without_key_to_column(ConstAggregateDataPtr __restrict
place,
- IColumn& to) const override {
- auto& col = assert_cast<ColumnUInt64&>(to);
- col.resize(1);
- reinterpret_cast<Data*>(col.get_data().data())->count =
- AggregateFunctionCountNotNullUnaryOld::data(place).count;
- }
-
- MutableColumnPtr create_serialize_column() const override {
- return ColumnVector<UInt64>::create();
- }
-
- DataTypePtr get_serialized_type() const override { return
std::make_shared<DataTypeUInt64>(); }
-};
-
-} // namespace doris::vectorized
\ No newline at end of file
diff --git
a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp
b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp
index 403bb5a117c..08e6e44311f 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp
+++ b/be/src/vec/aggregate_functions/aggregate_function_simple_factory.cpp
@@ -58,8 +58,6 @@ void
register_aggregate_function_collect_list(AggregateFunctionSimpleFactory& fa
void
register_aggregate_function_sequence_match(AggregateFunctionSimpleFactory&
factory);
void register_aggregate_function_avg_weighted(AggregateFunctionSimpleFactory&
factory);
void register_aggregate_function_histogram(AggregateFunctionSimpleFactory&
factory);
-void register_aggregate_function_count_old(AggregateFunctionSimpleFactory&
factory);
-void register_aggregate_function_sum_old(AggregateFunctionSimpleFactory&
factory);
void register_aggregate_function_map_agg(AggregateFunctionSimpleFactory&
factory);
void register_aggregate_function_bitmap_agg(AggregateFunctionSimpleFactory&
factory);
@@ -74,8 +72,6 @@ AggregateFunctionSimpleFactory&
AggregateFunctionSimpleFactory::instance() {
register_aggregate_function_avg(instance);
register_aggregate_function_count(instance);
register_aggregate_function_count_by_enum(instance);
- register_aggregate_function_count_old(instance);
- register_aggregate_function_sum_old(instance);
register_aggregate_function_uniq(instance);
register_aggregate_function_bit(instance);
register_aggregate_function_bitmap(instance);
diff --git a/be/src/vec/aggregate_functions/aggregate_function_sum_old.cpp
b/be/src/vec/aggregate_functions/aggregate_function_sum_old.cpp
deleted file mode 100644
index 9b5d3cf85a3..00000000000
--- a/be/src/vec/aggregate_functions/aggregate_function_sum_old.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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.
-// This file is copied from
-//
https://github.com/ClickHouse/ClickHouse/blob/master/src/AggregateFunctions/AggregateFunctionSum.cpp
-// and modified by Doris
-
-#include "vec/aggregate_functions/aggregate_function_sum_old.h"
-
-#include "vec/aggregate_functions/aggregate_function_simple_factory.h"
-#include "vec/aggregate_functions/helpers.h"
-
-namespace doris::vectorized {
-void register_aggregate_function_sum_old(AggregateFunctionSimpleFactory&
factory) {
- factory.register_alternative_function(
- "sum", creator_with_type::creator<AggregateFunctionSumSimpleOld>,
false);
- factory.register_alternative_function(
- "sum", creator_with_type::creator<AggregateFunctionSumSimpleOld>,
true);
-}
-} // namespace doris::vectorized
diff --git a/be/src/vec/aggregate_functions/aggregate_function_sum_old.h
b/be/src/vec/aggregate_functions/aggregate_function_sum_old.h
deleted file mode 100644
index a63c3d911af..00000000000
--- a/be/src/vec/aggregate_functions/aggregate_function_sum_old.h
+++ /dev/null
@@ -1,201 +0,0 @@
-// 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.
-// This file is copied from
-//
https://github.com/ClickHouse/ClickHouse/blob/master/src/AggregateFunctions/AggregateFunctionOldSum.h
-// and modified by Doris
-
-#pragma once
-
-#include <stddef.h>
-
-#include <memory>
-#include <type_traits>
-#include <vector>
-
-#include "vec/aggregate_functions/aggregate_function.h"
-#include "vec/aggregate_functions/aggregate_function_sum.h"
-#include "vec/columns/column.h"
-#include "vec/common/assert_cast.h"
-#include "vec/core/field.h"
-#include "vec/core/types.h"
-#include "vec/data_types/data_type.h"
-#include "vec/data_types/data_type_decimal.h"
-#include "vec/io/io_helper.h"
-namespace doris {
-namespace vectorized {
-class Arena;
-class BufferReadable;
-class BufferWritable;
-template <typename T>
-class ColumnDecimal;
-template <typename T>
-class DataTypeNumber;
-template <typename>
-class ColumnVector;
-} // namespace vectorized
-} // namespace doris
-
-namespace doris::vectorized {
-
-/*
- * this function is used to solve agg of sum/count is not compatibility during
the upgrade process
- * in PR #20370 have changed the serialize type and serialize column
- * before is ColumnVector, now sum/count change to use ColumnFixedLengthObject
- * so during the upgrade process, will be not compatible if exist old BE and
Newer BE
- */
-
-template <typename T, typename TResult, typename Data>
-class AggregateFunctionOldSum final
- : public IAggregateFunctionDataHelper<Data, AggregateFunctionOldSum<T,
TResult, Data>> {
-public:
- using ResultDataType = std::conditional_t<IsDecimalNumber<T>,
DataTypeDecimal<TResult>,
- DataTypeNumber<TResult>>;
- using ColVecType = std::conditional_t<IsDecimalNumber<T>,
ColumnDecimal<T>, ColumnVector<T>>;
- using ColVecResult =
- std::conditional_t<IsDecimalNumber<T>, ColumnDecimal<TResult>,
ColumnVector<TResult>>;
-
- String get_name() const override { return "sum"; }
-
- AggregateFunctionOldSum(const DataTypes& argument_types_)
- : IAggregateFunctionDataHelper<Data, AggregateFunctionOldSum<T,
TResult, Data>>(
- argument_types_),
- scale(get_decimal_scale(*argument_types_[0])) {}
-
- DataTypePtr get_return_type() const override {
- if constexpr (IsDecimalNumber<T>) {
- return
std::make_shared<ResultDataType>(ResultDataType::max_precision(), scale);
- } else {
- return std::make_shared<ResultDataType>();
- }
- }
-
- void add(AggregateDataPtr __restrict place, const IColumn** columns,
size_t row_num,
- Arena*) const override {
- const auto& column = assert_cast<const ColVecType&>(*columns[0]);
- this->data(place).add(column.get_data()[row_num]);
- }
-
- void reset(AggregateDataPtr place) const override { this->data(place).sum
= {}; }
-
- void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs,
- Arena*) const override {
- this->data(place).merge(this->data(rhs));
- }
-
- void serialize(ConstAggregateDataPtr __restrict place, BufferWritable&
buf) const override {
- this->data(place).write(buf);
- }
-
- void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf,
- Arena*) const override {
- this->data(place).read(buf);
- }
-
- void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn&
to) const override {
- auto& column = assert_cast<ColVecResult&>(to);
- column.get_data().push_back(this->data(place).get());
- }
-
- void deserialize_from_column(AggregateDataPtr places, const IColumn&
column, Arena* arena,
- size_t num_rows) const override {
- auto data = assert_cast<const ColVecResult&>(column).get_data().data();
- auto dst_data = reinterpret_cast<Data*>(places);
- for (size_t i = 0; i != num_rows; ++i) {
- dst_data[i].sum = data[i];
- }
- }
-
- void serialize_to_column(const std::vector<AggregateDataPtr>& places,
size_t offset,
- MutableColumnPtr& dst, const size_t num_rows)
const override {
- auto& col = assert_cast<ColVecResult&>(*dst);
- col.resize(num_rows);
- auto* data = col.get_data().data();
- for (size_t i = 0; i != num_rows; ++i) {
- data[i] = this->data(places[i] + offset).sum;
- }
- }
-
- void streaming_agg_serialize_to_column(const IColumn** columns,
MutableColumnPtr& dst,
- const size_t num_rows, Arena*
arena) const override {
- auto& col = assert_cast<ColVecResult&>(*dst);
- auto& src = assert_cast<const ColVecType&>(*columns[0]);
- col.resize(num_rows);
- auto* src_data = src.get_data().data();
- auto* dst_data = col.get_data().data();
- for (size_t i = 0; i != num_rows; ++i) {
- dst_data[i] = src_data[i];
- }
- }
-
- void deserialize_and_merge_vec(const AggregateDataPtr* places, size_t
offset,
- AggregateDataPtr rhs, const ColumnString*
column, Arena* arena,
- const size_t num_rows) const override {
- this->deserialize_from_column(rhs, *column, arena, num_rows);
- DEFER({ this->destroy_vec(rhs, num_rows); });
- this->merge_vec(places, offset, rhs, arena, num_rows);
- }
-
- void deserialize_and_merge_vec_selected(const AggregateDataPtr* places,
size_t offset,
- AggregateDataPtr rhs, const
ColumnString* column,
- Arena* arena, const size_t
num_rows) const override {
- this->deserialize_from_column(rhs, *column, arena, num_rows);
- DEFER({ this->destroy_vec(rhs, num_rows); });
- this->merge_vec_selected(places, offset, rhs, arena, num_rows);
- }
-
- void deserialize_and_merge_from_column(AggregateDataPtr __restrict place,
const IColumn& column,
- Arena* arena) const override {
- auto data = assert_cast<const ColVecResult&>(column).get_data().data();
- const size_t num_rows = column.size();
- for (size_t i = 0; i != num_rows; ++i) {
- this->data(place).sum += data[i];
- }
- }
-
- void serialize_without_key_to_column(ConstAggregateDataPtr __restrict
place,
- IColumn& to) const override {
- auto& col = assert_cast<ColVecResult&>(to);
- col.resize(1);
- reinterpret_cast<Data*>(col.get_data().data())->sum =
this->data(place).sum;
- }
-
- MutableColumnPtr create_serialize_column() const override {
- return get_return_type()->create_column();
- }
-
- DataTypePtr get_serialized_type() const override { return
get_return_type(); }
-
-private:
- UInt32 scale;
-};
-
-template <typename T, bool level_up>
-struct OldSumSimple {
- /// @note It uses slow Decimal128 (cause we need such a variant).
sumWithOverflow is faster for Decimal32/64
- using ResultType = std::conditional_t<level_up, DisposeDecimal<T,
NearestFieldType<T>>, T>;
- using AggregateDataType = AggregateFunctionSumData<ResultType>;
- using Function = AggregateFunctionOldSum<T, ResultType, AggregateDataType>;
-};
-
-template <typename T>
-using AggregateFunctionSumSimpleOld = typename OldSumSimple<T, true>::Function;
-
-// do not level up return type for agg reader
-template <typename T>
-using AggregateFunctionSumSimpleReaderOld = typename OldSumSimple<T,
false>::Function;
-
-} // namespace doris::vectorized
diff --git a/be/src/vec/functions/array/function_array_index.cpp
b/be/src/vec/functions/array/function_array_index.cpp
index c153d6843fb..63ee5e85264 100644
--- a/be/src/vec/functions/array/function_array_index.cpp
+++ b/be/src/vec/functions/array/function_array_index.cpp
@@ -25,6 +25,10 @@ void register_function_array_index(SimpleFunctionFactory&
factory) {
factory.register_function<FunctionArrayIndex<ArrayContainsAction>>();
factory.register_function<FunctionArrayIndex<ArrayPositionAction>>();
factory.register_function<FunctionArrayIndex<ArrayCountEqual>>();
+
+
factory.register_alternative_function<FunctionArrayIndex<ArrayContainsAction,
true>>();
+
factory.register_alternative_function<FunctionArrayIndex<ArrayPositionAction,
true>>();
+ factory.register_alternative_function<FunctionArrayIndex<ArrayCountEqual,
true>>();
}
} // namespace doris::vectorized
diff --git a/be/src/vec/functions/array/function_array_index.h
b/be/src/vec/functions/array/function_array_index.h
index 5b4d58e29d2..27aaa24cdad 100644
--- a/be/src/vec/functions/array/function_array_index.h
+++ b/be/src/vec/functions/array/function_array_index.h
@@ -70,7 +70,7 @@ struct ArrayCountEqual {
static constexpr void apply(ResultType& current, size_t j) noexcept {
++current; }
};
-template <typename ConcreteAction>
+template <typename ConcreteAction, bool OldVersion = false>
class FunctionArrayIndex : public IFunction {
public:
using ResultType = typename ConcreteAction::ResultType;
@@ -88,13 +88,20 @@ public:
bool use_default_implementation_for_nulls() const override { return false;
}
DataTypePtr get_return_type_impl(const DataTypes& arguments) const
override {
- // DCHECK(is_array(arguments[0]));
- return make_nullable(std::make_shared<DataTypeNumber<ResultType>>());
+ if constexpr (OldVersion) {
+ return
make_nullable(std::make_shared<DataTypeNumber<ResultType>>());
+ } else {
+ if (arguments[0]->is_nullable()) {
+ return
make_nullable(std::make_shared<DataTypeNumber<ResultType>>());
+ } else {
+ return std::make_shared<DataTypeNumber<ResultType>>();
+ }
+ }
}
Status execute_impl(FunctionContext* context, Block& block, const
ColumnNumbers& arguments,
size_t result, size_t input_rows_count) const override
{
- return _execute_non_nullable(block, arguments, result,
input_rows_count);
+ return _execute_dispatch(block, arguments, result, input_rows_count);
}
private:
@@ -160,7 +167,14 @@ private:
}
dst_data[row] = res;
}
- return ColumnNullable::create(std::move(dst),
std::move(dst_null_column));
+ if constexpr (OldVersion) {
+ return ColumnNullable::create(std::move(dst),
std::move(dst_null_column));
+ } else {
+ if (outer_null_map == nullptr) {
+ return dst;
+ }
+ return ColumnNullable::create(std::move(dst),
std::move(dst_null_column));
+ }
}
template <typename NestedColumnType, typename RightColumnType>
@@ -217,7 +231,14 @@ private:
}
dst_data[row] = res;
}
- return ColumnNullable::create(std::move(dst),
std::move(dst_null_column));
+ if constexpr (OldVersion) {
+ return ColumnNullable::create(std::move(dst),
std::move(dst_null_column));
+ } else {
+ if (outer_null_map == nullptr) {
+ return dst;
+ }
+ return ColumnNullable::create(std::move(dst),
std::move(dst_null_column));
+ }
}
template <typename NestedColumnType>
@@ -234,8 +255,8 @@ private:
return nullptr;
}
- Status _execute_non_nullable(Block& block, const ColumnNumbers& arguments,
size_t result,
- size_t input_rows_count) const {
+ Status _execute_dispatch(Block& block, const ColumnNumbers& arguments,
size_t result,
+ size_t input_rows_count) const {
// extract array offsets and nested data
auto left_column =
block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();
diff --git a/be/src/vec/functions/function_date_or_datetime_computation.cpp
b/be/src/vec/functions/function_date_or_datetime_computation.cpp
index bbeb3df5588..8fdfad86465 100644
--- a/be/src/vec/functions/function_date_or_datetime_computation.cpp
+++ b/be/src/vec/functions/function_date_or_datetime_computation.cpp
@@ -128,10 +128,6 @@ using FunctionMicroSecToDateTime =
TimestampToDateTime<MicroSec>;
using FunctionMilliSecToDateTime = TimestampToDateTime<MilliSec>;
using FunctionSecToDateTime = TimestampToDateTime<Sec>;
-/// @TEMPORARY: for be_exec_version=2
-using FunctionToWeekTwoArgsOld =
-
FunctionDateOrDateTimeComputation<ToWeekTwoArgsImplOld<DataTypeDateTime>>;
-
void register_function_date_time_computation(SimpleFunctionFactory& factory) {
factory.register_function<FunctionAddSeconds>();
factory.register_function<FunctionAddMinutes>();
@@ -190,8 +186,6 @@ void
register_function_date_time_computation(SimpleFunctionFactory& factory) {
factory.register_alias("days_add", "date_add");
factory.register_alias("days_add", "adddate");
factory.register_alias("months_add", "add_months");
- /// @TEMPORARY: for be_exec_version=2
- factory.register_alternative_function<FunctionToWeekTwoArgsOld>();
}
} // namespace doris::vectorized
diff --git a/be/src/vec/functions/function_date_or_datetime_computation.h
b/be/src/vec/functions/function_date_or_datetime_computation.h
index cf0304e188f..bb3f7db8c6f 100644
--- a/be/src/vec/functions/function_date_or_datetime_computation.h
+++ b/be/src/vec/functions/function_date_or_datetime_computation.h
@@ -370,8 +370,6 @@ TIME_DIFF_FUNCTION_IMPL(MicroSecondsDiffImpl,
microseconds_diff, MICROSECOND);
TIME_FUNCTION_TWO_ARGS_IMPL(ToYearWeekTwoArgsImpl, yearweek,
year_week(mysql_week_mode(mode)),
DataTypeInt32);
TIME_FUNCTION_TWO_ARGS_IMPL(ToWeekTwoArgsImpl, week,
week(mysql_week_mode(mode)), DataTypeInt8);
-/// @TEMPORARY: for be_exec_version=2
-TIME_FUNCTION_TWO_ARGS_IMPL(ToWeekTwoArgsImplOld, week,
week(mysql_week_mode(mode)), DataTypeInt32);
template <typename FromType1, typename FromType2, typename ToType, typename
Transform>
struct DateTimeOp {
diff --git a/be/src/vec/functions/function_date_or_datetime_computation_v2.cpp
b/be/src/vec/functions/function_date_or_datetime_computation_v2.cpp
index ee8a9bdd65b..ec9560456c1 100644
--- a/be/src/vec/functions/function_date_or_datetime_computation_v2.cpp
+++ b/be/src/vec/functions/function_date_or_datetime_computation_v2.cpp
@@ -113,10 +113,6 @@ using FunctionDatetimeV2ToYearWeekTwoArgs =
using FunctionDatetimeV2ToWeekTwoArgs =
FunctionDateOrDateTimeComputation<ToWeekTwoArgsImpl<DataTypeDateTimeV2>>;
-/// @TEMPORARY: for be_exec_version=2
-using FunctionDatetimeV2ToWeekTwoArgsOld =
-
FunctionDateOrDateTimeComputation<ToWeekTwoArgsImplOld<DataTypeDateTimeV2>>;
-
void register_function_date_time_computation_v2(SimpleFunctionFactory&
factory) {
factory.register_function<FunctionAddSecondsV2>();
factory.register_function<FunctionAddMinutesV2>();
@@ -183,9 +179,6 @@ void
register_function_date_time_computation_v2(SimpleFunctionFactory& factory)
factory.register_function<FunctionToWeekTwoArgsV2>();
factory.register_function<FunctionDatetimeV2ToYearWeekTwoArgs>();
factory.register_function<FunctionDatetimeV2ToWeekTwoArgs>();
-
- /// @TEMPORARY: for be_exec_version=2
-
factory.register_alternative_function<FunctionDatetimeV2ToWeekTwoArgsOld>();
}
} // namespace doris::vectorized
diff --git a/be/src/vec/functions/function_map.cpp
b/be/src/vec/functions/function_map.cpp
index dd342a07862..3ed681b1181 100644
--- a/be/src/vec/functions/function_map.cpp
+++ b/be/src/vec/functions/function_map.cpp
@@ -146,7 +146,7 @@ public:
}
};
-template <bool is_key>
+template <bool is_key, bool OldVersion = false>
class FunctionMapContains : public IFunction {
public:
static constexpr auto name = is_key ? "map_contains_key" :
"map_contains_value";
@@ -170,7 +170,16 @@ public:
}
DCHECK(is_map(datatype)) << "first argument for function: " << name
<< " should be DataTypeMap";
- return make_nullable(std::make_shared<DataTypeNumber<UInt8>>());
+
+ if constexpr (OldVersion) {
+ return make_nullable(std::make_shared<DataTypeNumber<UInt8>>());
+ } else {
+ if (arguments[0]->is_nullable()) {
+ return
make_nullable(std::make_shared<DataTypeNumber<UInt8>>());
+ } else {
+ return std::make_shared<DataTypeNumber<UInt8>>();
+ }
+ }
}
Status execute_impl(FunctionContext* context, Block& block, const
ColumnNumbers& arguments,
diff --git a/be/src/vec/functions/function_string.cpp
b/be/src/vec/functions/function_string.cpp
index bc0d40fa9ef..6179d64e47d 100644
--- a/be/src/vec/functions/function_string.cpp
+++ b/be/src/vec/functions/function_string.cpp
@@ -967,7 +967,7 @@ void register_function_string(SimpleFunctionFactory&
factory) {
factory.register_function<FunctionStringElt>();
factory.register_function<FunctionStringConcatWs>();
factory.register_function<FunctionStringAppendTrailingCharIfAbsent>();
- factory.register_function<FunctionStringRepeat<false>>();
+ factory.register_function<FunctionStringRepeat>();
factory.register_function<FunctionStringLPad>();
factory.register_function<FunctionStringRPad>();
factory.register_function<FunctionToBase64>();
@@ -1001,10 +1001,6 @@ void register_function_string(SimpleFunctionFactory&
factory) {
factory.register_alias(FunctionStringUTF8Length::name, "character_length");
factory.register_alias(FunctionStringDigestOneArg<SM3Sum>::name, "sm3");
factory.register_alias(FunctionStringDigestSHA1::name, "sha");
-
- /// @TEMPORARY: for be_exec_version=2
- factory.register_alternative_function<FunctionStringEltOld>();
- factory.register_alternative_function<FunctionStringRepeat<true>>();
}
} // namespace doris::vectorized
diff --git a/be/src/vec/functions/function_string.h
b/be/src/vec/functions/function_string.h
index 6fc611fc83a..69c2e3a5286 100644
--- a/be/src/vec/functions/function_string.h
+++ b/be/src/vec/functions/function_string.h
@@ -915,48 +915,6 @@ public:
}
};
-class FunctionStringEltOld : public IFunction {
-public:
- static constexpr auto name = "elt";
- static FunctionPtr create() { return
std::make_shared<FunctionStringEltOld>(); }
- String get_name() const override { return name; }
- size_t get_number_of_arguments() const override { return 0; }
- bool is_variadic() const override { return true; }
-
- DataTypePtr get_return_type_impl(const DataTypes& arguments) const
override {
- return std::make_shared<DataTypeString>();
- }
- bool use_default_implementation_for_nulls() const override { return true; }
- bool use_default_implementation_for_constants() const override { return
true; }
-
- Status execute_impl(FunctionContext* context, Block& block, const
ColumnNumbers& arguments,
- size_t result, size_t input_rows_count) const override
{
- int arguent_size = arguments.size();
- auto pos_col =
-
block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();
- if (auto* nullable = check_and_get_column<const
ColumnNullable>(*pos_col)) {
- pos_col = nullable->get_nested_column_ptr();
- }
- auto& pos_data = assert_cast<const
ColumnInt32*>(pos_col.get())->get_data();
- auto pos = pos_data[0];
- int num_children = arguent_size - 1;
- if (pos < 1 || num_children == 0 || pos > num_children) {
- auto null_map = ColumnUInt8::create(input_rows_count, 1);
- auto res = ColumnString::create();
- auto& res_data = res->get_chars();
- auto& res_offset = res->get_offsets();
- res_offset.resize(input_rows_count);
- for (size_t i = 0; i < input_rows_count; ++i) {
- res_offset[i] = res_data.size();
- }
- block.get_by_position(result).column =
- ColumnNullable::create(std::move(res),
std::move(null_map));
- return Status::OK();
- }
- block.get_by_position(result).column =
block.get_by_position(arguments[pos]).column;
- return Status::OK();
- }
-};
// concat_ws (string,string....) or (string, Array)
// TODO: avoid use fmtlib
class FunctionStringConcatWs : public IFunction {
@@ -1166,7 +1124,7 @@ private:
}
}
};
-template <bool use_old_function>
+
class FunctionStringRepeat : public IFunction {
public:
static constexpr auto name = "repeat";
@@ -1199,12 +1157,8 @@ public:
} else if (auto* col2_const =
check_and_get_column<ColumnConst>(*argument_ptr[1])) {
DCHECK(check_and_get_column<ColumnInt32>(col2_const->get_data_column()));
int repeat = 0;
- if constexpr (use_old_function) {
- repeat = col2_const->get_int(0);
- } else {
- repeat = std::min<int>(col2_const->get_int(0),
- context->state()->repeat_max_num());
- }
+ repeat = std::min<int>(col2_const->get_int(0),
context->state()->repeat_max_num());
+
if (repeat <= 0) {
null_map->get_data().resize_fill(input_rows_count, 0);
res->insert_many_defaults(input_rows_count);
@@ -1236,11 +1190,8 @@ public:
const char* raw_str = reinterpret_cast<const
char*>(&data[offsets[i - 1]]);
size_t size = offsets[i] - offsets[i - 1];
int repeat = 0;
- if constexpr (use_old_function) {
- repeat = repeats[i];
- } else {
- repeat = std::min<int>(repeats[i], repeat_max_num);
- }
+ repeat = std::min<int>(repeats[i], repeat_max_num);
+
if (repeat <= 0) {
StringOP::push_empty_string(i, res_data, res_offsets);
} else if (repeat * size > DEFAULT_MAX_STRING_SIZE) {
diff --git a/be/src/vec/functions/simple_function_factory.h
b/be/src/vec/functions/simple_function_factory.h
index 86d4d45b1ff..8d64e9da34b 100644
--- a/be/src/vec/functions/simple_function_factory.h
+++ b/be/src/vec/functions/simple_function_factory.h
@@ -106,8 +106,8 @@ class SimpleFunctionFactory {
using Creator = std::function<FunctionBuilderPtr()>;
using FunctionCreators = phmap::flat_hash_map<std::string, Creator>;
using FunctionIsVariadic = phmap::flat_hash_set<std::string>;
- /// @TEMPORARY: for be_exec_version=2
- constexpr static int DATETIME_FUNCTION_NEW = 2;
+ /// @TEMPORARY: for be_exec_version=3
+ constexpr static int NEWEST_VERSION_FUNCTION_SUBSTITUTE = 3;
public:
void register_function(const std::string& name, const Creator& ptr) {
@@ -143,10 +143,10 @@ public:
function_alias[alias] = name;
}
- /// @TEMPORARY: for be_exec_version=2
+ /// @TEMPORARY: for be_exec_version=3
template <class Function>
void register_alternative_function() {
- static std::string suffix {"_old_for_version_before_2_0"};
+ static std::string suffix {"_old_for_version_before_3_0"};
function_to_replace[Function::name] = Function::name + suffix;
register_function(Function::name + suffix,
&createDefaultFunction<Function>);
}
@@ -186,7 +186,7 @@ private:
FunctionCreators function_creators;
FunctionIsVariadic function_variadic_set;
std::unordered_map<std::string, std::string> function_alias;
- /// @TEMPORARY: for be_exec_version=2. replace function to old version.
+ /// @TEMPORARY: for be_exec_version=3. replace function to old version.
std::unordered_map<std::string, std::string> function_to_replace;
template <typename Function>
@@ -194,10 +194,10 @@ private:
return std::make_shared<DefaultFunctionBuilder>(Function::create());
}
- /// @TEMPORARY: for be_exec_version=2
+ /// @TEMPORARY: for be_exec_version=3
void temporary_function_update(int fe_version_now, std::string& name) {
// replace if fe is old version.
- if (fe_version_now < DATETIME_FUNCTION_NEW &&
+ if (fe_version_now < NEWEST_VERSION_FUNCTION_SUBSTITUTE &&
function_to_replace.find(name) != function_to_replace.end()) {
name = function_to_replace[name];
}
diff --git a/be/src/vec/functions/time_of_function.cpp
b/be/src/vec/functions/time_of_function.cpp
index 8e2f5d73a99..ff01e1e0eaf 100644
--- a/be/src/vec/functions/time_of_function.cpp
+++ b/be/src/vec/functions/time_of_function.cpp
@@ -60,34 +60,6 @@ using FunctionDateTimeV2YearWeek =
using FunctionDateTimeV2WeekDay =
FunctionDateOrDateTimeToSomething<DataTypeInt8, WeekDayImpl<UInt64>>;
-/// @TEMPORARY: for be_exec_version=2
-using FunctionWeekOfYearOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
WeekOfYearImpl<Int64>>;
-using FunctionWeekOfYearV2Old =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
WeekOfYearImpl<UInt32>>;
-using FunctionDayOfYearOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfYearImpl<Int64>>;
-using FunctionDayOfYearV2Old =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfYearImpl<UInt32>>;
-using FunctionDayOfWeekOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfWeekImpl<Int64>>;
-using FunctionDayOfWeekV2Old =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfWeekImpl<UInt32>>;
-using FunctionDayOfMonthOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfMonthImpl<Int64>>;
-using FunctionDayOfMonthV2Old =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfMonthImpl<UInt32>>;
-using FunctionWeekDayOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
WeekDayImpl<Int64>>;
-using FunctionWeekDayV2Old = FunctionDateOrDateTimeToSomething<DataTypeInt32,
WeekDayImpl<UInt32>>;
-using FunctionDateTimeV2WeekOfYearOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
WeekOfYearImpl<UInt64>>;
-using FunctionDateTimeV2DayOfYearOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfYearImpl<UInt64>>;
-using FunctionDateTimeV2DayOfWeekOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfWeekImpl<UInt64>>;
-using FunctionDateTimeV2DayOfMonthOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
DayOfMonthImpl<UInt64>>;
-using FunctionDateTimeV2WeekDayOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32, WeekDayImpl<UInt64>>;
-
void register_function_time_of_function(SimpleFunctionFactory& factory) {
factory.register_function<FunctionDayOfWeek>();
factory.register_function<FunctionDayOfMonth>();
@@ -107,22 +79,5 @@ void
register_function_time_of_function(SimpleFunctionFactory& factory) {
factory.register_function<FunctionDateTimeV2DayOfMonth>();
factory.register_function<FunctionDateTimeV2YearWeek>();
factory.register_function<FunctionDateTimeV2WeekDay>();
-
- /// @TEMPORARY: for be_exec_version=2
- factory.register_alternative_function<FunctionWeekOfYearOld>();
- factory.register_alternative_function<FunctionWeekOfYearV2Old>();
- factory.register_alternative_function<FunctionDateTimeV2WeekOfYearOld>();
- factory.register_alternative_function<FunctionDayOfYearOld>();
- factory.register_alternative_function<FunctionDayOfYearV2Old>();
- factory.register_alternative_function<FunctionDateTimeV2DayOfYearOld>();
- factory.register_alternative_function<FunctionDayOfWeekOld>();
- factory.register_alternative_function<FunctionDayOfWeekV2Old>();
- factory.register_alternative_function<FunctionDateTimeV2DayOfWeekOld>();
- factory.register_alternative_function<FunctionDayOfMonthOld>();
- factory.register_alternative_function<FunctionDayOfMonthV2Old>();
- factory.register_alternative_function<FunctionDateTimeV2DayOfMonthOld>();
- factory.register_alternative_function<FunctionWeekDayOld>();
- factory.register_alternative_function<FunctionWeekDayV2Old>();
- factory.register_alternative_function<FunctionDateTimeV2WeekDayOld>();
}
} // namespace doris::vectorized
diff --git a/be/src/vec/functions/to_time_function.cpp
b/be/src/vec/functions/to_time_function.cpp
index e3676a4aea9..126296fc40a 100644
--- a/be/src/vec/functions/to_time_function.cpp
+++ b/be/src/vec/functions/to_time_function.cpp
@@ -81,42 +81,6 @@ using FunctionTimeStamp =
FunctionDateOrDateTimeToSomething<DataTypeDateTime, Ti
using FunctionTimeStampV2 =
FunctionDateOrDateTimeToSomething<DataTypeDateTimeV2,
TimeStampImpl<UInt64>>;
-/// @TEMPORARY: for be_exec_version=2
-using FunctionYearOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToYearImpl<Int64>>;
-using FunctionYearV2Old = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToYearImpl<UInt32>>;
-using FunctionQuarterOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToQuarterImpl<Int64>>;
-using FunctionQuarterV2Old =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToQuarterImpl<UInt32>>;
-using FunctionMonthOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToMonthImpl<Int64>>;
-using FunctionMonthV2Old = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToMonthImpl<UInt32>>;
-using FunctionWeekOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToWeekOneArgImpl<Int64>>;
-using FunctionWeekV2Old =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToWeekOneArgImpl<UInt32>>;
-using FunctionDayOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToDayImpl<Int64>>;
-using FunctionDayV2Old = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToDayImpl<UInt32>>;
-using FunctionHourOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToHourImpl<Int64>>;
-using FunctionHourV2Old = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToHourImpl<UInt32>>;
-using FunctionMinuteOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToMinuteImpl<Int64>>;
-using FunctionMinuteV2Old = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToMinuteImpl<UInt32>>;
-using FunctionSecondOld = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToSecondImpl<Int64>>;
-using FunctionSecondV2Old = FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToSecondImpl<UInt32>>;
-using FunctionDateTimeV2YearOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32, ToYearImpl<UInt64>>;
-using FunctionDateTimeV2QuarterOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToQuarterImpl<UInt64>>;
-using FunctionDateTimeV2MonthOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32, ToMonthImpl<UInt64>>;
-using FunctionDateTimeV2WeekOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32,
ToWeekOneArgImpl<UInt64>>;
-using FunctionDateTimeV2DayOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32, ToDayImpl<UInt64>>;
-using FunctionDateTimeV2HourOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32, ToHourImpl<UInt64>>;
-using FunctionDateTimeV2MinuteOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32, ToMinuteImpl<UInt64>>;
-using FunctionDateTimeV2SecondOld =
- FunctionDateOrDateTimeToSomething<DataTypeInt32, ToSecondImpl<UInt64>>;
-
void register_function_to_time_function(SimpleFunctionFactory& factory) {
factory.register_function<FunctionSecond>();
factory.register_function<FunctionMinute>();
@@ -156,32 +120,6 @@ void
register_function_to_time_function(SimpleFunctionFactory& factory) {
factory.register_function<FunctionDateTimeV2Date>();
factory.register_alias("date", "datev2");
factory.register_alias("to_date", "to_datev2");
-
- /// @TEMPORARY: for be_exec_version=2
- factory.register_alternative_function<FunctionYearOld>();
- factory.register_alternative_function<FunctionQuarterOld>();
- factory.register_alternative_function<FunctionMonthOld>();
- factory.register_alternative_function<FunctionDayOld>();
- factory.register_alternative_function<FunctionWeekOld>();
- factory.register_alternative_function<FunctionHourOld>();
- factory.register_alternative_function<FunctionMinuteOld>();
- factory.register_alternative_function<FunctionSecondOld>();
- factory.register_alternative_function<FunctionYearV2Old>();
- factory.register_alternative_function<FunctionQuarterV2Old>();
- factory.register_alternative_function<FunctionMonthV2Old>();
- factory.register_alternative_function<FunctionWeekV2Old>();
- factory.register_alternative_function<FunctionDayV2Old>();
- factory.register_alternative_function<FunctionHourV2Old>();
- factory.register_alternative_function<FunctionMinuteV2Old>();
- factory.register_alternative_function<FunctionSecondV2Old>();
- factory.register_alternative_function<FunctionDateTimeV2YearOld>();
- factory.register_alternative_function<FunctionDateTimeV2QuarterOld>();
- factory.register_alternative_function<FunctionDateTimeV2MonthOld>();
- factory.register_alternative_function<FunctionDateTimeV2WeekOld>();
- factory.register_alternative_function<FunctionDateTimeV2DayOld>();
- factory.register_alternative_function<FunctionDateTimeV2HourOld>();
- factory.register_alternative_function<FunctionDateTimeV2MinuteOld>();
- factory.register_alternative_function<FunctionDateTimeV2SecondOld>();
}
} // namespace doris::vectorized
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
index 22d1c7e150f..d8749ad6cca 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
@@ -2387,6 +2387,12 @@ public abstract class Expr extends TreeNode<Expr>
implements ParseNode, Cloneabl
}
return false;
}
+ if (fn.functionName().equalsIgnoreCase("array_contains") ||
fn.functionName().equalsIgnoreCase("array_position")
+ || fn.functionName().equalsIgnoreCase("countequal")
+ || fn.functionName().equalsIgnoreCase("map_contains_key")
+ || fn.functionName().equalsIgnoreCase("map_contains_value")) {
+ return children.get(0).isNullable();
+ }
return true;
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayContains.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayContains.java
index 9b02b6ce76e..494a4a863c5 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayContains.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayContains.java
@@ -19,7 +19,6 @@ package
org.apache.doris.nereids.trees.expressions.functions.scalar;
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.BinaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -37,7 +36,7 @@ import java.util.List;
* ScalarFunction 'array_contains'. This class is generated by
GenerateFunction.
*/
public class ArrayContains extends ScalarFunction
- implements BinaryExpression, ExplicitlyCastableSignature,
AlwaysNullable {
+ implements BinaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BooleanType.INSTANCE)
@@ -60,6 +59,11 @@ public class ArrayContains extends ScalarFunction
return new ArrayContains(children.get(0), children.get(1));
}
+ @Override
+ public boolean nullable() {
+ return child(0).nullable();
+ }
+
@Override
public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
return visitor.visitArrayContains(this, context);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayPosition.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayPosition.java
index ecaac29e7c4..3a94e84d511 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayPosition.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayPosition.java
@@ -19,7 +19,6 @@ package
org.apache.doris.nereids.trees.expressions.functions.scalar;
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.BinaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -37,7 +36,7 @@ import java.util.List;
* ScalarFunction 'array_position'. This class is generated by
GenerateFunction.
*/
public class ArrayPosition extends ScalarFunction
- implements BinaryExpression, ExplicitlyCastableSignature,
AlwaysNullable {
+ implements BinaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BigIntType.INSTANCE)
@@ -60,6 +59,11 @@ public class ArrayPosition extends ScalarFunction
return new ArrayPosition(children.get(0), children.get(1));
}
+ @Override
+ public boolean nullable() {
+ return child(0).nullable();
+ }
+
@Override
public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
return visitor.visitArrayPosition(this, context);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CountEqual.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CountEqual.java
index 95b5b5b29e8..2ba0c907243 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CountEqual.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/CountEqual.java
@@ -19,7 +19,6 @@ package
org.apache.doris.nereids.trees.expressions.functions.scalar;
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.BinaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -37,7 +36,7 @@ import java.util.List;
* ScalarFunction 'countequal'. This class is generated by GenerateFunction.
*/
public class CountEqual extends ScalarFunction
- implements BinaryExpression, ExplicitlyCastableSignature,
AlwaysNullable {
+ implements BinaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BigIntType.INSTANCE)
@@ -60,6 +59,11 @@ public class CountEqual extends ScalarFunction
return new CountEqual(children.get(0), children.get(1));
}
+ @Override
+ public boolean nullable() {
+ return child(0).nullable();
+ }
+
@Override
public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
return visitor.visitCountEqual(this, context);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsKey.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsKey.java
index 94e1718f3f7..b489bd47963 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsKey.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsKey.java
@@ -19,7 +19,6 @@ package
org.apache.doris.nereids.trees.expressions.functions.scalar;
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.BinaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -37,7 +36,7 @@ import java.util.List;
* ScalarFunction 'map_contains_key'. This class is generated by
GenerateFunction.
*/
public class MapContainsKey extends ScalarFunction
- implements BinaryExpression, ExplicitlyCastableSignature,
AlwaysNullable {
+ implements BinaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BooleanType.INSTANCE)
@@ -61,6 +60,11 @@ public class MapContainsKey extends ScalarFunction
return new MapContainsKey(children.get(0), children.get(1));
}
+ @Override
+ public boolean nullable() {
+ return child(0).nullable();
+ }
+
@Override
public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
return visitor.visitMapContainsKey(this, context);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsValue.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsValue.java
index 196a07e136e..de77386c889 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsValue.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MapContainsValue.java
@@ -19,7 +19,6 @@ package
org.apache.doris.nereids.trees.expressions.functions.scalar;
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.BinaryExpression;
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
@@ -37,7 +36,7 @@ import java.util.List;
* ScalarFunction 'map_contains_value'. This class is generated by
GenerateFunction.
*/
public class MapContainsValue extends ScalarFunction
- implements BinaryExpression, ExplicitlyCastableSignature,
AlwaysNullable {
+ implements BinaryExpression, ExplicitlyCastableSignature {
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
FunctionSignature.ret(BooleanType.INSTANCE)
@@ -61,6 +60,11 @@ public class MapContainsValue extends ScalarFunction
return new MapContainsValue(children.get(0), children.get(1));
}
+ @Override
+ public boolean nullable() {
+ return child(0).nullable();
+ }
+
@Override
public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
return visitor.visitMapContainsValue(this, context);
diff --git a/gensrc/script/doris_builtins_functions.py
b/gensrc/script/doris_builtins_functions.py
index 991caa9e531..bdddde58036 100644
--- a/gensrc/script/doris_builtins_functions.py
+++ b/gensrc/script/doris_builtins_functions.py
@@ -76,8 +76,8 @@ visible_functions = {
[['map'], 'MAP<K, V>', ['K', 'V', '...'], 'ALWAYS_NOT_NULLABLE', ['K',
'V']],
[['element_at', '%element_extract%'], 'V', ['MAP<K, V>', 'K'],
'ALWAYS_NULLABLE', ['K', 'V']],
[['size', 'map_size'], 'BIGINT', ['MAP<K, V>'], '', ['K', 'V']],
- [['map_contains_key'], 'BOOLEAN', ['MAP<K, V>', 'K'],
'ALWAYS_NULLABLE', ['K', 'V']],
- [['map_contains_value'], 'BOOLEAN', ['MAP<K, V>', 'V'],
'ALWAYS_NULLABLE', ['K', 'V']],
+ [['map_contains_key'], 'BOOLEAN', ['MAP<K, V>', 'K'], 'CUSTOM', ['K',
'V']],
+ [['map_contains_value'], 'BOOLEAN', ['MAP<K, V>', 'V'], 'CUSTOM',
['K', 'V']],
#[['map_contains_key_like'], 'BOOLEAN', ['MAP<K, V>', 'K'], '', ['K',
'V']],
[['map_keys'], 'ARRAY<K>', ['MAP<K, V>'], '', ['K', 'V']],
[['map_values'], 'ARRAY<V>', ['MAP<K, V>'], '', ['K', 'V']],
@@ -165,24 +165,24 @@ visible_functions = {
[['arrays_overlap'], 'BOOLEAN', ['ARRAY_VARCHAR', 'ARRAY_VARCHAR'],
'ALWAYS_NULLABLE'],
[['arrays_overlap'], 'BOOLEAN', ['ARRAY_STRING', 'ARRAY_STRING'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_BOOLEAN', 'BOOLEAN'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_TINYINT', 'TINYINT'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_SMALLINT', 'SMALLINT'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_INT', 'INT'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_BIGINT', 'BIGINT'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_LARGEINT', 'LARGEINT'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DATETIME', 'DATETIME'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DATE', 'DATE'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DATETIMEV2', 'DATETIMEV2'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DATEV2', 'DATEV2'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_FLOAT', 'FLOAT'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DOUBLE', 'DOUBLE'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMALV2', 'DECIMALV2'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMAL32', 'DECIMAL32'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMAL64', 'DECIMAL64'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMAL128', 'DECIMAL128'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_VARCHAR', 'VARCHAR'],
'ALWAYS_NULLABLE'],
- [['array_contains'], 'BOOLEAN', ['ARRAY_STRING', 'STRING'],
'ALWAYS_NULLABLE'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_BOOLEAN', 'BOOLEAN'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_TINYINT', 'TINYINT'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_SMALLINT', 'SMALLINT'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_INT', 'INT'], 'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_BIGINT', 'BIGINT'], 'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_LARGEINT', 'LARGEINT'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DATETIME', 'DATETIME'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DATE', 'DATE'], 'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DATETIMEV2', 'DATETIMEV2'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DATEV2', 'DATEV2'], 'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_FLOAT', 'FLOAT'], 'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DOUBLE', 'DOUBLE'], 'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMALV2', 'DECIMALV2'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMAL32', 'DECIMAL32'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMAL64', 'DECIMAL64'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMAL128', 'DECIMAL128'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_VARCHAR', 'VARCHAR'],
'CUSTOM'],
+ [['array_contains'], 'BOOLEAN', ['ARRAY_STRING', 'STRING'], 'CUSTOM'],
[['array_cum_sum'], 'ARRAY_BIGINT', ['ARRAY_TINYINT'], ''],
[['array_cum_sum'], 'ARRAY_BIGINT', ['ARRAY_SMALLINT'], ''],
@@ -234,43 +234,43 @@ visible_functions = {
[['array_enumerate_uniq'], 'ARRAY_BIGINT', ['ARRAY_VARCHAR', '...'],
''],
[['array_enumerate_uniq'], 'ARRAY_BIGINT', ['ARRAY_STRING', '...'],
''],
- [['countequal'], 'BIGINT', ['ARRAY_BOOLEAN', 'BOOLEAN'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_TINYINT', 'TINYINT'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_SMALLINT', 'SMALLINT'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_INT', 'INT'], 'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_BIGINT', 'BIGINT'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_LARGEINT', 'LARGEINT'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DATETIME', 'DATETIME'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DATE', 'DATE'], 'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DATETIMEV2', 'DATETIMEV2'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DATEV2', 'DATEV2'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_FLOAT', 'FLOAT'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DOUBLE', 'DOUBLE'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DECIMALV2', 'DECIMALV2'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DECIMAL32', 'DECIMAL32'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DECIMAL64', 'DECIMAL64'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_DECIMAL128', 'DECIMAL128'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_VARCHAR', 'VARCHAR'],
'ALWAYS_NULLABLE'],
- [['countequal'], 'BIGINT', ['ARRAY_STRING', 'STRING'],
'ALWAYS_NULLABLE'],
-
- [['array_position'], 'BIGINT', ['ARRAY_BOOLEAN', 'BOOLEAN'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_TINYINT', 'TINYINT'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_SMALLINT', 'SMALLINT'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_INT', 'INT'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_BIGINT', 'BIGINT'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_LARGEINT', 'LARGEINT'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DATETIME', 'DATETIME'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DATE', 'DATE'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DATETIMEV2', 'DATETIMEV2'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DATEV2', 'DATEV2'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_FLOAT', 'FLOAT'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DOUBLE', 'DOUBLE'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DECIMALV2', 'DECIMALV2'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DECIMAL32', 'DECIMAL32'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DECIMAL64', 'DECIMAL64'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_DECIMAL128', 'DECIMAL128'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_VARCHAR', 'VARCHAR'],
'ALWAYS_NULLABLE'],
- [['array_position'], 'BIGINT', ['ARRAY_STRING', 'STRING'],
'ALWAYS_NULLABLE'],
+ [['countequal'], 'BIGINT', ['ARRAY_BOOLEAN', 'BOOLEAN'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_TINYINT', 'TINYINT'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_SMALLINT', 'SMALLINT'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_INT', 'INT'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_BIGINT', 'BIGINT'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_LARGEINT', 'LARGEINT'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DATETIME', 'DATETIME'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DATE', 'DATE'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DATETIMEV2', 'DATETIMEV2'],
'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DATEV2', 'DATEV2'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_FLOAT', 'FLOAT'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DOUBLE', 'DOUBLE'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DECIMALV2', 'DECIMALV2'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DECIMAL32', 'DECIMAL32'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DECIMAL64', 'DECIMAL64'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_DECIMAL128', 'DECIMAL128'],
'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_VARCHAR', 'VARCHAR'], 'CUSTOM'],
+ [['countequal'], 'BIGINT', ['ARRAY_STRING', 'STRING'], 'CUSTOM'],
+
+ [['array_position'], 'BIGINT', ['ARRAY_BOOLEAN', 'BOOLEAN'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_TINYINT', 'TINYINT'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_SMALLINT', 'SMALLINT'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_INT', 'INT'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_BIGINT', 'BIGINT'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_LARGEINT', 'LARGEINT'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DATETIME', 'DATETIME'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DATE', 'DATE'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DATETIMEV2', 'DATETIMEV2'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DATEV2', 'DATEV2'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_FLOAT', 'FLOAT'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DOUBLE', 'DOUBLE'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DECIMALV2', 'DECIMALV2'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DECIMAL32', 'DECIMAL32'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DECIMAL64', 'DECIMAL64'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_DECIMAL128', 'DECIMAL128'],
'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_VARCHAR', 'VARCHAR'], 'CUSTOM'],
+ [['array_position'], 'BIGINT', ['ARRAY_STRING', 'STRING'], 'CUSTOM'],
[['cardinality', 'size', 'array_size'], 'BIGINT', ['ARRAY'], ''],
[['array_distinct'], 'ARRAY_BOOLEAN', ['ARRAY_BOOLEAN'], ''],
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]