be/src/exprs/function/array/function_array_range.cpp
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #include <glog/logging.h> |
19 | | |
20 | | #include <algorithm> |
21 | | #include <boost/iterator/iterator_facade.hpp> |
22 | | #include <cstddef> |
23 | | #include <memory> |
24 | | #include <utility> |
25 | | |
26 | | #include "common/status.h" |
27 | | #include "core/assert_cast.h" |
28 | | #include "core/block/block.h" |
29 | | #include "core/block/column_numbers.h" |
30 | | #include "core/block/column_with_type_and_name.h" |
31 | | #include "core/column/column.h" |
32 | | #include "core/column/column_array.h" |
33 | | #include "core/column/column_nullable.h" |
34 | | #include "core/column/column_vector.h" |
35 | | #include "core/data_type/data_type.h" |
36 | | #include "core/data_type/data_type_array.h" |
37 | | #include "core/data_type/data_type_date_or_datetime_v2.h" |
38 | | #include "core/data_type/data_type_date_time.h" |
39 | | #include "core/data_type/data_type_nullable.h" |
40 | | #include "core/data_type/define_primitive_type.h" |
41 | | #include "core/pod_array_fwd.h" |
42 | | #include "core/types.h" |
43 | | #include "core/value/vdatetime_value.h" |
44 | | #include "exprs/aggregate/aggregate_function.h" |
45 | | #include "exprs/function/function.h" |
46 | | #include "exprs/function/function_date_or_datetime_computation.h" |
47 | | #include "exprs/function/simple_function_factory.h" |
48 | | |
49 | | namespace doris { |
50 | | class FunctionContext; |
51 | | } // namespace doris |
52 | | |
53 | | namespace doris { |
54 | | #include "common/compile_check_begin.h" |
55 | | |
56 | | template <typename Impl> |
57 | | class FunctionArrayRange : public IFunction { |
58 | | public: |
59 | | static constexpr auto name = Impl::name; |
60 | | |
61 | 24 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); }_ZN5doris18FunctionArrayRangeINS_12RangeOneImplILNS_13PrimitiveTypeE5EvEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE5EvEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE26EvEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE5EvEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_9EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_8EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_7EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_6EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_5EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_4EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_3EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
_ZN5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_2EEEEE6createEv Line | Count | Source | 61 | 2 | static FunctionPtr create() { return std::make_shared<FunctionArrayRange>(); } |
|
62 | | |
63 | | /// Get function name. |
64 | 0 | String get_name() const override { return name; }Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeOneImplILNS_13PrimitiveTypeE5EvEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE5EvEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE26EvEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE5EvEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_9EEEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_8EEEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_7EEEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_6EEEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_5EEEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_4EEEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_3EEEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_2EEEEE8get_nameB5cxx11Ev |
65 | | |
66 | 12 | bool is_variadic() const override { return true; }_ZNK5doris18FunctionArrayRangeINS_12RangeOneImplILNS_13PrimitiveTypeE5EvEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE5EvEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE26EvEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE5EvEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_9EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_8EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_7EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_6EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_5EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_4EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_3EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_2EEEEE11is_variadicEv Line | Count | Source | 66 | 1 | bool is_variadic() const override { return true; } |
|
67 | | |
68 | 0 | size_t get_number_of_arguments() const override { |
69 | 0 | return get_variadic_argument_types_impl().size(); |
70 | 0 | } Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeOneImplILNS_13PrimitiveTypeE5EvEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE5EvEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE26EvEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE5EvEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_9EEEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_8EEEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_7EEEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_6EEEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_5EEEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_4EEEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_3EEEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_2EEEEE23get_number_of_argumentsEv |
71 | | |
72 | 12 | DataTypes get_variadic_argument_types_impl() const override { |
73 | 12 | return Impl::get_variadic_argument_types(); |
74 | 12 | } _ZNK5doris18FunctionArrayRangeINS_12RangeOneImplILNS_13PrimitiveTypeE5EvEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE5EvEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE26EvEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE5EvEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_9EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_8EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_7EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_6EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_5EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_4EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_3EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
_ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_2EEEEE32get_variadic_argument_types_implEv Line | Count | Source | 72 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 73 | 1 | return Impl::get_variadic_argument_types(); | 74 | 1 | } |
|
75 | | |
76 | 0 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
77 | 0 | auto nested_type = make_nullable(Impl::get_data_type()); |
78 | 0 | auto res = std::make_shared<DataTypeArray>(nested_type); |
79 | 0 | return make_nullable(res); |
80 | 0 | } Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeOneImplILNS_13PrimitiveTypeE5EvEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE5EvEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE26EvEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE5EvEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS9_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_9EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_8EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_7EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_6EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_5EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_4EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_3EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_2EEEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISC_EE |
81 | | |
82 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
83 | 0 | uint32_t result, size_t input_rows_count) const override { |
84 | 0 | return Impl::execute_impl(context, block, arguments, result, input_rows_count); |
85 | 0 | } Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeOneImplILNS_13PrimitiveTypeE5EvEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE5EvEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_12RangeTwoImplILNS_13PrimitiveTypeE26EvEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE5EvEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_9EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_8EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_7EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_6EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_5EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_4EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_3EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris18FunctionArrayRangeINS_14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS4_2EEEEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm |
86 | | }; |
87 | | |
88 | | template <PrimitiveType SourceDataPType, typename TimeUnitOrVoid = void> |
89 | | struct RangeImplUtil { |
90 | | using SourceDataType = typename PrimitiveTypeTraits<SourceDataPType>::CppType; |
91 | | using DataType = typename PrimitiveTypeTraits<SourceDataPType>::DataType; |
92 | | |
93 | 0 | static DataTypePtr get_data_type() { return std::make_shared<DataType>(); }Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE5EvE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26EvE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_9EEE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_8EEE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_7EEE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_6EEE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_5EEE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_4EEE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_3EEE13get_data_typeEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_2EEE13get_data_typeEv |
94 | | |
95 | 0 | static constexpr const char* get_function_name() { |
96 | 0 | if constexpr (std::is_same_v<SourceDataType, DateV2Value<DateTimeV2ValueType>> && |
97 | 0 | !std::is_same_v<TimeUnitOrVoid, void>) { |
98 | 0 | if constexpr (std::is_same_v<TimeUnitOrVoid, |
99 | 0 | std::integral_constant<TimeUnit, TimeUnit::YEAR>>) { |
100 | 0 | return "array_range_year_unit"; |
101 | 0 | } else if constexpr (std::is_same_v< |
102 | 0 | TimeUnitOrVoid, |
103 | 0 | std::integral_constant<TimeUnit, TimeUnit::QUARTER>>) { |
104 | 0 | return "array_range_quarter_unit"; |
105 | 0 | } else if constexpr (std::is_same_v< |
106 | 0 | TimeUnitOrVoid, |
107 | 0 | std::integral_constant<TimeUnit, TimeUnit::MONTH>>) { |
108 | 0 | return "array_range_month_unit"; |
109 | 0 | } else if constexpr (std::is_same_v<TimeUnitOrVoid, |
110 | 0 | std::integral_constant<TimeUnit, TimeUnit::WEEK>>) { |
111 | 0 | return "array_range_week_unit"; |
112 | 0 | } else if constexpr (std::is_same_v<TimeUnitOrVoid, |
113 | 0 | std::integral_constant<TimeUnit, TimeUnit::DAY>>) { |
114 | 0 | return "array_range_day_unit"; |
115 | 0 | } else if constexpr (std::is_same_v<TimeUnitOrVoid, |
116 | 0 | std::integral_constant<TimeUnit, TimeUnit::HOUR>>) { |
117 | 0 | return "array_range_hour_unit"; |
118 | 0 | } else if constexpr (std::is_same_v< |
119 | 0 | TimeUnitOrVoid, |
120 | 0 | std::integral_constant<TimeUnit, TimeUnit::MINUTE>>) { |
121 | 0 | return "array_range_minute_unit"; |
122 | 0 | } else if constexpr (std::is_same_v< |
123 | 0 | TimeUnitOrVoid, |
124 | 0 | std::integral_constant<TimeUnit, TimeUnit::SECOND>>) { |
125 | 0 | return "array_range_second_unit"; |
126 | 0 | } |
127 | 0 | } else { |
128 | 0 | return "array_range"; |
129 | 0 | } |
130 | 0 | } Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE5EvE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26EvE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_9EEE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_8EEE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_7EEE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_6EEE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_5EEE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_4EEE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_3EEE17get_function_nameEv Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_2EEE17get_function_nameEv |
131 | | |
132 | | static constexpr auto name = get_function_name(); |
133 | | |
134 | | static Status range_execute(Block& block, const ColumnNumbers& arguments, uint32_t result, |
135 | 0 | size_t input_rows_count) { |
136 | 0 | DCHECK_EQ(arguments.size(), 3); |
137 | 0 | auto return_nested_type = make_nullable(std::make_shared<DataType>()); |
138 | 0 | auto dest_array_column_ptr = ColumnArray::create(return_nested_type->create_column(), |
139 | 0 | ColumnArray::ColumnOffsets::create()); |
140 | 0 | IColumn* dest_nested_column = &dest_array_column_ptr->get_data(); |
141 | 0 | auto* dest_nested_nullable_col = assert_cast<ColumnNullable*>(dest_nested_column); |
142 | 0 | dest_nested_column = dest_nested_nullable_col->get_nested_column_ptr().get(); |
143 | 0 | auto& dest_nested_null_map = dest_nested_nullable_col->get_null_map_column().get_data(); |
144 | |
|
145 | 0 | auto args_null_map = ColumnUInt8::create(input_rows_count, 0); |
146 | 0 | ColumnPtr argument_columns[3]; |
147 | 0 | for (int i = 0; i < 3; ++i) { |
148 | 0 | argument_columns[i] = |
149 | 0 | block.get_by_position(arguments[i]).column->convert_to_full_column_if_const(); |
150 | 0 | } |
151 | 0 | auto start_column = |
152 | 0 | assert_cast<const ColumnVector<SourceDataPType>*>(argument_columns[0].get()); |
153 | 0 | auto end_column = |
154 | 0 | assert_cast<const ColumnVector<SourceDataPType>*>(argument_columns[1].get()); |
155 | 0 | const auto* step_column = assert_cast<const ColumnInt32*>(argument_columns[2].get()); |
156 | |
|
157 | 0 | DCHECK(dest_nested_column != nullptr); |
158 | 0 | auto& dest_offsets = dest_array_column_ptr->get_offsets(); |
159 | 0 | auto nested_column = reinterpret_cast<ColumnVector<SourceDataPType>*>(dest_nested_column); |
160 | 0 | dest_offsets.reserve(input_rows_count); |
161 | 0 | dest_nested_column->reserve(input_rows_count); |
162 | 0 | dest_nested_null_map.reserve(input_rows_count); |
163 | |
|
164 | 0 | RETURN_IF_ERROR(vector(start_column->get_data(), end_column->get_data(), |
165 | 0 | step_column->get_data(), args_null_map->get_data(), |
166 | 0 | nested_column->get_data(), dest_nested_null_map, dest_offsets)); |
167 | | |
168 | 0 | block.get_by_position(result).column = |
169 | 0 | ColumnNullable::create(std::move(dest_array_column_ptr), std::move(args_null_map)); |
170 | 0 | return Status::OK(); |
171 | 0 | } Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE5EvE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26EvE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_9EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_8EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_7EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_6EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_5EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_4EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_3EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_2EEE13range_executeERNS_5BlockERKSt6vectorIjSaIjEEjm |
172 | | |
173 | | private: |
174 | | static Status vector(const PaddedPODArray<SourceDataType>& start, |
175 | | const PaddedPODArray<SourceDataType>& end, |
176 | | const PaddedPODArray<Int32>& step, NullMap& args_null_map, |
177 | | PaddedPODArray<SourceDataType>& nested_column, |
178 | | PaddedPODArray<UInt8>& dest_nested_null_map, |
179 | 0 | ColumnArray::Offsets64& dest_offsets) { |
180 | 0 | size_t rows = start.size(); |
181 | 0 | for (auto row = 0; row < rows; ++row) { |
182 | 0 | auto idx = start[row]; |
183 | 0 | auto end_row = end[row]; |
184 | 0 | auto step_row = step[row]; |
185 | 0 | auto args_null_map_row = args_null_map[row]; |
186 | 0 | if constexpr (std::is_same_v<SourceDataType, Int32>) { |
187 | 0 | if (args_null_map_row || idx < 0 || end_row < 0 || step_row <= 0) { |
188 | 0 | args_null_map[row] = 1; |
189 | 0 | dest_offsets.push_back(dest_offsets.back()); |
190 | 0 | continue; |
191 | 0 | } else { |
192 | 0 | if (idx < end_row && step_row > 0 && |
193 | 0 | ((static_cast<__int128_t>(end_row) - static_cast<__int128_t>(idx) - 1) / |
194 | 0 | static_cast<__int128_t>(step_row) + |
195 | 0 | 1) > max_array_size_as_field) { |
196 | 0 | return Status::InvalidArgument("Array size exceeds the limit {}", |
197 | 0 | max_array_size_as_field); |
198 | 0 | } |
199 | 0 | size_t offset = dest_offsets.back(); |
200 | 0 | while (idx < end[row]) { |
201 | 0 | nested_column.push_back(idx); |
202 | 0 | dest_nested_null_map.push_back(0); |
203 | 0 | offset++; |
204 | 0 | idx = idx + step_row; |
205 | 0 | } |
206 | 0 | dest_offsets.push_back(offset); |
207 | 0 | } |
208 | 0 | } else { |
209 | 0 | const auto& idx_0 = reinterpret_cast<const DateV2Value<DateTimeV2ValueType>&>(idx); |
210 | 0 | const auto& end_row_cast = |
211 | 0 | reinterpret_cast<const DateV2Value<DateTimeV2ValueType>&>(end_row); |
212 | 0 | bool is_null = !idx_0.is_valid_date(); |
213 | 0 | bool is_end_row_invalid = !end_row_cast.is_valid_date(); |
214 | 0 | if (args_null_map_row || step_row <= 0 || is_null || is_end_row_invalid) { |
215 | 0 | args_null_map[row] = 1; |
216 | 0 | dest_offsets.push_back(dest_offsets.back()); |
217 | 0 | continue; |
218 | 0 | } else { |
219 | 0 | size_t offset = dest_offsets.back(); |
220 | 0 | using UNIT = std::conditional_t<std::is_same_v<TimeUnitOrVoid, void>, |
221 | 0 | std::integral_constant<TimeUnit, TimeUnit::DAY>, |
222 | 0 | TimeUnitOrVoid>; |
223 | 0 | int move = 0; |
224 | 0 | while (doris::datetime_diff<UNIT::value, DateTimeV2ValueType, |
225 | 0 | DateTimeV2ValueType>(idx, end_row) > 0) { |
226 | 0 | if (move > max_array_size_as_field) { |
227 | 0 | return Status::InvalidArgument("Array size exceeds the limit {}", |
228 | 0 | max_array_size_as_field); |
229 | 0 | } |
230 | 0 | nested_column.push_back(idx); |
231 | 0 | dest_nested_null_map.push_back(0); |
232 | 0 | offset++; |
233 | 0 | move++; |
234 | 0 | idx = doris::date_time_add<UNIT::value, TYPE_DATETIMEV2, Int32>(idx, |
235 | 0 | step_row); |
236 | 0 | } |
237 | 0 | dest_offsets.push_back(offset); |
238 | 0 | } |
239 | 0 | } |
240 | 0 | } |
241 | 0 | return Status::OK(); |
242 | 0 | } Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE5EvE6vectorERKNS_8PODArrayIiLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEES9_S9_RNS3_IhLm4096ES6_Lm16ELm15EEERS7_SB_RNS3_ImLm4096ES6_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26EvE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESC_RKNS3_IiLm4096ES9_Lm16ELm15EEERNS3_IhLm4096ES9_Lm16ELm15EEERSA_SH_RNS3_ImLm4096ES9_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_9EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_8EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_7EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_6EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_5EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_4EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_3EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris13RangeImplUtilILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_2EEE6vectorERKNS_8PODArrayINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEESF_RKNS6_IiLm4096ESC_Lm16ELm15EEERNS6_IhLm4096ESC_Lm16ELm15EEERSD_SK_RNS6_ImLm4096ESC_Lm16ELm15EEE |
243 | | }; |
244 | | |
245 | | template <PrimitiveType SourceDataPType, typename TimeUnitOrVoid = void> |
246 | | struct RangeOneImpl : public RangeImplUtil<SourceDataPType, TimeUnitOrVoid> { |
247 | 1 | static DataTypes get_variadic_argument_types() { |
248 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>()}; |
249 | 1 | } |
250 | | |
251 | | static Status execute_impl(FunctionContext* context, Block& block, |
252 | | const ColumnNumbers& arguments, uint32_t result, |
253 | 0 | size_t input_rows_count) { |
254 | 0 | using ColumnType = |
255 | 0 | std::conditional_t<SourceDataPType == TYPE_INT, ColumnInt32, ColumnDateTimeV2>; |
256 | 0 | auto start_column = ColumnType::create(input_rows_count, 0); |
257 | 0 | auto step_column = ColumnInt32::create(input_rows_count, 1); |
258 | 0 | block.insert({std::move(start_column), |
259 | 0 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), |
260 | 0 | "start_column"}); |
261 | 0 | block.insert({std::move(step_column), std::make_shared<DataTypeInt32>(), "step_column"}); |
262 | 0 | ColumnNumbers temp_arguments = {block.columns() - 2, arguments[0], block.columns() - 1}; |
263 | 0 | return (RangeImplUtil<SourceDataPType, TimeUnitOrVoid>::range_execute)( |
264 | 0 | block, temp_arguments, result, input_rows_count); |
265 | 0 | } |
266 | | }; |
267 | | |
268 | | template <PrimitiveType SourceDataPType, typename TimeUnitOrVoid = void> |
269 | | struct RangeTwoImpl : public RangeImplUtil<SourceDataPType, TimeUnitOrVoid> { |
270 | 2 | static DataTypes get_variadic_argument_types() { |
271 | 2 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), |
272 | 2 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>()}; |
273 | 2 | } _ZN5doris12RangeTwoImplILNS_13PrimitiveTypeE5EvE27get_variadic_argument_typesEv Line | Count | Source | 270 | 1 | static DataTypes get_variadic_argument_types() { | 271 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 272 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>()}; | 273 | 1 | } |
_ZN5doris12RangeTwoImplILNS_13PrimitiveTypeE26EvE27get_variadic_argument_typesEv Line | Count | Source | 270 | 1 | static DataTypes get_variadic_argument_types() { | 271 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 272 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>()}; | 273 | 1 | } |
|
274 | | |
275 | | static Status execute_impl(FunctionContext* context, Block& block, |
276 | | const ColumnNumbers& arguments, uint32_t result, |
277 | 0 | size_t input_rows_count) { |
278 | 0 | auto step_column = ColumnInt32::create(input_rows_count, 1); |
279 | 0 | block.insert({std::move(step_column), std::make_shared<DataTypeInt32>(), "step_column"}); |
280 | 0 | ColumnNumbers temp_arguments = {arguments[0], arguments[1], block.columns() - 1}; |
281 | 0 | return (RangeImplUtil<SourceDataPType, TimeUnitOrVoid>::range_execute)( |
282 | 0 | block, temp_arguments, result, input_rows_count); |
283 | 0 | } Unexecuted instantiation: _ZN5doris12RangeTwoImplILNS_13PrimitiveTypeE5EvE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris12RangeTwoImplILNS_13PrimitiveTypeE26EvE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm |
284 | | }; |
285 | | |
286 | | template <PrimitiveType SourceDataPType, typename TimeUnitOrVoid = void> |
287 | | struct RangeThreeImpl : public RangeImplUtil<SourceDataPType, TimeUnitOrVoid> { |
288 | 9 | static DataTypes get_variadic_argument_types() { |
289 | 9 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), |
290 | 9 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), |
291 | 9 | std::make_shared<DataTypeInt32>()}; |
292 | 9 | } _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE5EvE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_9EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_8EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_7EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_6EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_5EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_4EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_3EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
_ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_2EEE27get_variadic_argument_typesEv Line | Count | Source | 288 | 1 | static DataTypes get_variadic_argument_types() { | 289 | 1 | return {std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 290 | 1 | std::make_shared<typename RangeImplUtil<SourceDataPType>::DataType>(), | 291 | 1 | std::make_shared<DataTypeInt32>()}; | 292 | 1 | } |
|
293 | | |
294 | | static Status execute_impl(FunctionContext* context, Block& block, |
295 | | const ColumnNumbers& arguments, uint32_t result, |
296 | 0 | size_t input_rows_count) { |
297 | 0 | return (RangeImplUtil<SourceDataPType, TimeUnitOrVoid>::range_execute)( |
298 | 0 | block, arguments, result, input_rows_count); |
299 | 0 | } Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE5EvE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_9EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_8EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_7EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_6EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_5EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_4EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_3EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris14RangeThreeImplILNS_13PrimitiveTypeE26ESt17integral_constantINS_8TimeUnitELS3_2EEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm |
300 | | }; |
301 | | |
302 | 1 | void register_function_array_range(SimpleFunctionFactory& factory) { |
303 | | /// One argument, just for Int32 |
304 | 1 | factory.register_function<FunctionArrayRange<RangeOneImpl<TYPE_INT>>>(); |
305 | | |
306 | | /// Two arguments, for Int32 and DateTimeV2 without Interval |
307 | 1 | factory.register_function<FunctionArrayRange<RangeTwoImpl<TYPE_INT>>>(); |
308 | 1 | factory.register_function<FunctionArrayRange<RangeTwoImpl<TYPE_DATETIMEV2>>>(); |
309 | | |
310 | | /// Three arguments, for Int32 and DateTimeV2 with YEAR to SECOND Interval |
311 | 1 | factory.register_function<FunctionArrayRange<RangeThreeImpl<TYPE_INT>>>(); |
312 | 1 | factory.register_function<FunctionArrayRange< |
313 | 1 | RangeThreeImpl<TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::YEAR>>>>(); |
314 | 1 | factory.register_function<FunctionArrayRange<RangeThreeImpl< |
315 | 1 | TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::QUARTER>>>>(); |
316 | 1 | factory.register_function<FunctionArrayRange< |
317 | 1 | RangeThreeImpl<TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::MONTH>>>>(); |
318 | 1 | factory.register_function<FunctionArrayRange< |
319 | 1 | RangeThreeImpl<TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::WEEK>>>>(); |
320 | 1 | factory.register_function<FunctionArrayRange< |
321 | 1 | RangeThreeImpl<TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::DAY>>>>(); |
322 | 1 | factory.register_function<FunctionArrayRange< |
323 | 1 | RangeThreeImpl<TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::HOUR>>>>(); |
324 | 1 | factory.register_function<FunctionArrayRange< |
325 | 1 | RangeThreeImpl<TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::MINUTE>>>>(); |
326 | 1 | factory.register_function<FunctionArrayRange< |
327 | 1 | RangeThreeImpl<TYPE_DATETIMEV2, std::integral_constant<TimeUnit, TimeUnit::SECOND>>>>(); |
328 | | |
329 | | // alias |
330 | 1 | factory.register_alias("array_range", "sequence"); |
331 | 1 | } |
332 | | |
333 | | } // namespace doris |