This is an automated email from the ASF dual-hosted git repository. eldenmoon 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 5f6371bf0ff [Improve](datatype) change check_column to check data type (#25466) 5f6371bf0ff is described below commit 5f6371bf0ffcba992880aaf3f369c4a916039a33 Author: amory <wangqian...@selectdb.com> AuthorDate: Mon Oct 23 18:36:37 2023 +0800 [Improve](datatype) change check_column to check data type (#25466) * change check_column to check data type * fix is_number contains is_decimal * fix array element --- .../functions/array/function_array_difference.h | 29 ++++--- .../vec/functions/array/function_array_element.h | 41 +++++---- be/src/vec/functions/array/function_array_index.h | 34 ++++---- be/src/vec/functions/array/function_array_remove.h | 34 ++++---- .../vec/functions/array/function_arrays_overlap.h | 98 ++++++++++------------ be/src/vec/functions/function_bitmap.cpp | 12 +-- 6 files changed, 128 insertions(+), 120 deletions(-) diff --git a/be/src/vec/functions/array/function_array_difference.h b/be/src/vec/functions/array/function_array_difference.h index 492d7cdcb77..956cd51fa24 100644 --- a/be/src/vec/functions/array/function_array_difference.h +++ b/be/src/vec/functions/array/function_array_difference.h @@ -201,39 +201,42 @@ private: ColumnPtr res = nullptr; auto left_element_type = remove_nullable(assert_cast<const DataTypeArray&>(*arg.type).get_nested_type()); - if (check_column<ColumnUInt8>(*nested_column)) { + WhichDataType which_type(left_element_type); + if (which_type.is_uint8()) { res = _execute_number_expanded<UInt8, Int16>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnInt8>(*nested_column)) { + } else if (which_type.is_int8()) { res = _execute_number_expanded<Int8, Int16>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnInt16>(*nested_column)) { + } else if (which_type.is_int16()) { res = _execute_number_expanded<Int16, Int32>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnInt32>(*nested_column)) { + } else if (which_type.is_int32()) { res = _execute_number_expanded<Int32, Int64>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnInt64>(*nested_column)) { + } else if (which_type.is_int64()) { res = _execute_number_expanded<Int64, Int128>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnInt128>(*nested_column)) { + } else if (which_type.is_int128()) { res = _execute_number_expanded<Int128, Int128>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnFloat32>(*nested_column)) { + } else if (which_type.is_float32()) { res = _execute_number_expanded<Float32, Float64>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnFloat64>(*nested_column)) { + } else if (which_type.is_float64()) { res = _execute_number_expanded<Float64, Float64>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnDecimal32>(*nested_column)) { + } else if (which_type.is_decimal32()) { res = _execute_number_expanded<Decimal32, Decimal32>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnDecimal64>(*nested_column)) { + } else if (which_type.is_decimal64()) { res = _execute_number_expanded<Decimal64, Decimal64>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnDecimal128I>(*nested_column)) { + } else if (which_type.is_decimal128i()) { res = _execute_number_expanded<Decimal128I, Decimal128I>(offsets, *nested_column, nested_null_map); - } else if (check_column<ColumnDecimal128>(*nested_column)) { + } else if (which_type.is_decimal128()) { res = _execute_number_expanded<Decimal128, Decimal128>(offsets, *nested_column, nested_null_map); + } else { + return nullptr; } - return ColumnArray::create(std::move(res), array_column.get_offsets_ptr()); + return ColumnArray::create(res, array_column.get_offsets_ptr()); } }; diff --git a/be/src/vec/functions/array/function_array_element.h b/be/src/vec/functions/array/function_array_element.h index fcd54c6dfaa..5c7627261f3 100644 --- a/be/src/vec/functions/array/function_array_element.h +++ b/be/src/vec/functions/array/function_array_element.h @@ -280,7 +280,7 @@ private: } DataTypePtr indices_type(std::make_shared<MapIndiceDataType>()); ColumnWithTypeAndName indices(matched_indices, indices_type, "indices"); - ColumnWithTypeAndName data(val_arr, val_type, "value"); + ColumnWithTypeAndName data(val_arr, std::make_shared<DataTypeArray>(val_type), "value"); ColumnsWithTypeAndName args = {data, indices}; return _execute_nullable(args, input_rows_count, src_null_map, dst_null_map); } @@ -342,58 +342,63 @@ private: } ColumnPtr res = nullptr; + auto left_element_type = remove_nullable( + assert_cast<const DataTypeArray&>(*remove_nullable(arguments[0].type)) + .get_nested_type()); + WhichDataType which_type(left_element_type); // because we impl use_default_implementation_for_nulls // we should handle array index column by-self, and array index should not be nullable. auto idx_col = remove_nullable(arguments[1].column); - if (nested_column->is_date_type()) { + // we should dispatch branch according to data type rather than column type + if (which_type.is_date()) { res = _execute_number<ColumnDate>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (nested_column->is_datetime_type()) { + } else if (which_type.is_date_time()) { res = _execute_number<ColumnDateTime>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnDateV2>(nested_column)) { + } else if (which_type.is_date_v2()) { res = _execute_number<ColumnDateV2>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnDateTimeV2>(nested_column)) { + } else if (which_type.is_date_time_v2()) { res = _execute_number<ColumnDateTime>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnUInt8>(*nested_column)) { + } else if (which_type.is_uint8()) { res = _execute_number<ColumnUInt8>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnInt8>(*nested_column)) { + } else if (which_type.is_int8()) { res = _execute_number<ColumnInt8>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnInt16>(*nested_column)) { + } else if (which_type.is_int16()) { res = _execute_number<ColumnInt16>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnInt32>(*nested_column)) { + } else if (which_type.is_int32()) { res = _execute_number<ColumnInt32>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnInt64>(*nested_column)) { + } else if (which_type.is_int64()) { res = _execute_number<ColumnInt64>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnInt128>(*nested_column)) { + } else if (which_type.is_int128()) { res = _execute_number<ColumnInt128>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnFloat32>(*nested_column)) { + } else if (which_type.is_float32()) { res = _execute_number<ColumnFloat32>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnFloat64>(*nested_column)) { + } else if (which_type.is_float64()) { res = _execute_number<ColumnFloat64>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnDecimal32>(*nested_column)) { + } else if (which_type.is_decimal32()) { res = _execute_number<ColumnDecimal32>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnDecimal64>(*nested_column)) { + } else if (which_type.is_decimal64()) { res = _execute_number<ColumnDecimal64>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnDecimal128I>(*nested_column)) { + } else if (which_type.is_decimal128i()) { res = _execute_number<ColumnDecimal128I>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnDecimal128>(*nested_column)) { + } else if (which_type.is_decimal128()) { res = _execute_number<ColumnDecimal128>(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); - } else if (check_column<ColumnString>(*nested_column)) { + } else if (which_type.is_string_or_fixed_string()) { res = _execute_string(offsets, *nested_column, src_null_map, *idx_col, nested_null_map, dst_null_map); } else { diff --git a/be/src/vec/functions/array/function_array_index.h b/be/src/vec/functions/array/function_array_index.h index 27aaa24cdad..a7208df68e5 100644 --- a/be/src/vec/functions/array/function_array_index.h +++ b/be/src/vec/functions/array/function_array_index.h @@ -303,55 +303,57 @@ private: auto right_type = remove_nullable(block.get_by_position(arguments[1]).type); ColumnPtr return_column = nullptr; + WhichDataType left_which_type(left_element_type); + if (is_string(right_type) && is_string(left_element_type)) { return_column = _execute_string(offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); } else if (is_number(right_type) && is_number(left_element_type)) { - if (check_column<ColumnUInt8>(*nested_column)) { + if (left_which_type.is_uint8()) { return_column = _execute_number_expanded<ColumnUInt8>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnInt8>(*nested_column)) { + } else if (left_which_type.is_int8()) { return_column = _execute_number_expanded<ColumnInt8>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnInt16>(*nested_column)) { + } else if (left_which_type.is_int16()) { return_column = _execute_number_expanded<ColumnInt16>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnInt32>(*nested_column)) { + } else if (left_which_type.is_int32()) { return_column = _execute_number_expanded<ColumnInt32>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnInt64>(*nested_column)) { + } else if (left_which_type.is_int64()) { return_column = _execute_number_expanded<ColumnInt64>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnInt128>(*nested_column)) { + } else if (left_which_type.is_int128()) { return_column = _execute_number_expanded<ColumnInt128>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnFloat32>(*nested_column)) { + } else if (left_which_type.is_float32()) { return_column = _execute_number_expanded<ColumnFloat32>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnFloat64>(*nested_column)) { + } else if (left_which_type.is_float64()) { return_column = _execute_number_expanded<ColumnFloat64>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnDecimal32>(*nested_column)) { + } else if (left_which_type.is_decimal32()) { return_column = _execute_number_expanded<ColumnDecimal32>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnDecimal64>(*nested_column)) { + } else if (left_which_type.is_decimal64()) { return_column = _execute_number_expanded<ColumnDecimal64>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnDecimal128I>(*nested_column)) { + } else if (left_which_type.is_decimal128i()) { return_column = _execute_number_expanded<ColumnDecimal128I>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnDecimal128>(*nested_column)) { + } else if (left_which_type.is_decimal128()) { return_column = _execute_number_expanded<ColumnDecimal128>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); @@ -359,19 +361,19 @@ private: } else if ((is_date_or_datetime(right_type) || is_date_v2_or_datetime_v2(right_type)) && (is_date_or_datetime(left_element_type) || is_date_v2_or_datetime_v2(left_element_type))) { - if (nested_column->is_date_type()) { + if (left_which_type.is_date()) { return_column = _execute_number_expanded<ColumnDate>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (nested_column->is_datetime_type()) { + } else if (left_which_type.is_date_time()) { return_column = _execute_number_expanded<ColumnDateTime>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnDateV2>(*nested_column)) { + } else if (left_which_type.is_date_v2()) { return_column = _execute_number_expanded<ColumnDateV2>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); - } else if (check_column<ColumnDateTimeV2>(*nested_column)) { + } else if (left_which_type.is_date_time_v2()) { return_column = _execute_number_expanded<ColumnDateTimeV2>( offsets, nested_null_map, *nested_column, *right_column, right_nested_null_map, array_null_map); diff --git a/be/src/vec/functions/array/function_array_remove.h b/be/src/vec/functions/array/function_array_remove.h index eb33952a2db..d60426d4302 100644 --- a/be/src/vec/functions/array/function_array_remove.h +++ b/be/src/vec/functions/array/function_array_remove.h @@ -288,60 +288,62 @@ private: auto right_type = remove_nullable((arguments[1]).type); ColumnPtr res = nullptr; + WhichDataType left_which_type(left_element_type); + if (is_string(right_type) && is_string(left_element_type)) { res = _execute_string(offsets, *nested_column, *right_column, nested_null_map); } else if (is_number(right_type) && is_number(left_element_type)) { - if (check_column<ColumnUInt8>(*nested_column)) { + if (left_which_type.is_uint8()) { res = _execute_number_expanded<ColumnUInt8>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnInt8>(*nested_column)) { + } else if (left_which_type.is_int8()) { res = _execute_number_expanded<ColumnInt8>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnInt16>(*nested_column)) { + } else if (left_which_type.is_int16()) { res = _execute_number_expanded<ColumnInt16>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnInt32>(*nested_column)) { + } else if (left_which_type.is_int32()) { res = _execute_number_expanded<ColumnInt32>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnInt64>(*nested_column)) { + } else if (left_which_type.is_int64()) { res = _execute_number_expanded<ColumnInt64>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnInt128>(*nested_column)) { + } else if (left_which_type.is_int128()) { res = _execute_number_expanded<ColumnInt128>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnFloat32>(*nested_column)) { + } else if (left_which_type.is_float32()) { res = _execute_number_expanded<ColumnFloat32>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnFloat64>(*nested_column)) { + } else if (left_which_type.is_float64()) { res = _execute_number_expanded<ColumnFloat64>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnDecimal32>(*nested_column)) { + } else if (left_which_type.is_decimal32()) { res = _execute_number_expanded<ColumnDecimal32>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnDecimal64>(*nested_column)) { + } else if (left_which_type.is_decimal64()) { res = _execute_number_expanded<ColumnDecimal64>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnDecimal128I>(*nested_column)) { + } else if (left_which_type.is_decimal128i()) { res = _execute_number_expanded<ColumnDecimal128I>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnDecimal128>(*nested_column)) { + } else if (left_which_type.is_decimal128()) { res = _execute_number_expanded<ColumnDecimal128>(offsets, *nested_column, *right_column, nested_null_map); } } else if (is_date_or_datetime(right_type) && is_date_or_datetime(left_element_type)) { - if (nested_column->is_date_type()) { + if (left_which_type.is_date()) { res = _execute_number_expanded<ColumnDate>(offsets, *nested_column, *right_column, nested_null_map); - } else if (nested_column->is_datetime_type()) { + } else if (left_which_type.is_date_time()) { res = _execute_number_expanded<ColumnDateTime>(offsets, *nested_column, *right_column, nested_null_map); } } else if (is_date_v2_or_datetime_v2(right_type) && is_date_v2_or_datetime_v2(left_element_type)) { - if (check_column<ColumnDateV2>(*nested_column)) { + if (left_which_type.is_date_v2()) { res = _execute_number_expanded<ColumnDateV2>(offsets, *nested_column, *right_column, nested_null_map); - } else if (check_column<ColumnDateTimeV2>(*nested_column)) { + } else if (left_which_type.is_date_time_v2()) { res = _execute_number_expanded<ColumnDateTimeV2>(offsets, *nested_column, *right_column, nested_null_map); } diff --git a/be/src/vec/functions/array/function_arrays_overlap.h b/be/src/vec/functions/array/function_arrays_overlap.h index 7af722e10a5..a1a7a953228 100644 --- a/be/src/vec/functions/array/function_arrays_overlap.h +++ b/be/src/vec/functions/array/function_arrays_overlap.h @@ -149,7 +149,6 @@ public: !extract_column_array_info(*right_column, right_exec_data)) { return ret; } - // prepare return column auto dst_nested_col = ColumnVector<UInt8>::create(input_rows_count, 0); auto dst_null_map = ColumnVector<UInt8>::create(input_rows_count, 0); @@ -160,77 +159,72 @@ public: RETURN_IF_ERROR(_execute_nullable(right_exec_data, dst_null_map_data)); // execute overlap check - if (left_exec_data.nested_col->is_column_string()) { + auto array_type = remove_nullable(block.get_by_position(arguments[0]).type); + auto left_element_type = + remove_nullable(assert_cast<const DataTypeArray&>(*array_type).get_nested_type()); + WhichDataType left_which_type(left_element_type); + if (left_which_type.is_string()) { ret = _execute_internal<ColumnString>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } else if (left_exec_data.nested_col->is_date_type()) { + } else if (left_which_type.is_date()) { ret = _execute_internal<ColumnDate>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } else if (left_exec_data.nested_col->is_datetime_type()) { + } else if (left_which_type.is_date_time()) { ret = _execute_internal<ColumnDateTime>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } else if (check_column<ColumnDateV2>(left_exec_data.nested_col)) { + } else if (left_which_type.is_date_v2()) { ret = _execute_internal<ColumnDateV2>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } else if (check_column<ColumnDateTimeV2>(left_exec_data.nested_col)) { + } else if (left_which_type.is_date_time_v2()) { ret = _execute_internal<ColumnDateTimeV2>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } else if (left_exec_data.nested_col->is_numeric()) { - if (check_column<ColumnUInt8>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnUInt8>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnInt8>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnInt8>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnInt16>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnInt16>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnInt32>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnInt32>(left_exec_data, right_exec_data, + } else if (left_which_type.is_uint8()) { + ret = _execute_internal<ColumnUInt8>(left_exec_data, right_exec_data, dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_int8()) { + ret = _execute_internal<ColumnInt8>(left_exec_data, right_exec_data, dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_int16()) { + ret = _execute_internal<ColumnInt16>(left_exec_data, right_exec_data, dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_int32()) { + ret = _execute_internal<ColumnInt32>(left_exec_data, right_exec_data, dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_int64()) { + ret = _execute_internal<ColumnInt64>(left_exec_data, right_exec_data, dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_int128()) { + ret = _execute_internal<ColumnInt128>(left_exec_data, right_exec_data, + dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_float32()) { + ret = _execute_internal<ColumnFloat32>(left_exec_data, right_exec_data, + dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_float64()) { + ret = _execute_internal<ColumnFloat64>(left_exec_data, right_exec_data, + dst_null_map_data, + dst_nested_col->get_data().data()); + } else if (left_which_type.is_decimal32()) { + ret = _execute_internal<ColumnDecimal32>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } else if (check_column<ColumnInt64>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnInt64>(left_exec_data, right_exec_data, + } else if (left_which_type.is_decimal64()) { + ret = _execute_internal<ColumnDecimal64>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } else if (check_column<ColumnInt128>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnInt128>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnFloat32>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnFloat32>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnFloat64>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnFloat64>(left_exec_data, right_exec_data, + } else if (left_which_type.is_decimal128i()) { + ret = _execute_internal<ColumnDecimal128I>(left_exec_data, right_exec_data, dst_null_map_data, dst_nested_col->get_data().data()); - } - } else if (left_exec_data.nested_col->is_column_decimal()) { - if (check_column<ColumnDecimal32>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnDecimal32>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnDecimal64>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnDecimal64>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnDecimal128I>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnDecimal128I>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } else if (check_column<ColumnDecimal128>(*left_exec_data.nested_col)) { - ret = _execute_internal<ColumnDecimal128>(left_exec_data, right_exec_data, - dst_null_map_data, - dst_nested_col->get_data().data()); - } + } else if (left_which_type.is_decimal128()) { + ret = _execute_internal<ColumnDecimal128>(left_exec_data, right_exec_data, + dst_null_map_data, + dst_nested_col->get_data().data()); } if (ret.ok()) { diff --git a/be/src/vec/functions/function_bitmap.cpp b/be/src/vec/functions/function_bitmap.cpp index d2289b3fa61..effced6a818 100644 --- a/be/src/vec/functions/function_bitmap.cpp +++ b/be/src/vec/functions/function_bitmap.cpp @@ -379,19 +379,21 @@ public: static_cast<const ColumnNullable&>(array_column.get_data()); const auto& nested_column = nested_nullable_column.get_nested_column(); const auto& nested_null_map = nested_nullable_column.get_null_map_column().get_data(); - if (check_column<ColumnInt8>(nested_column)) { + + WhichDataType which_type(argument_type); + if (which_type.is_int8()) { static_cast<void>(Impl::template vector<ColumnInt8>( offset_column_data, nested_column, nested_null_map, res, null_map)); - } else if (check_column<ColumnUInt8>(nested_column)) { + } else if (which_type.is_uint8()) { static_cast<void>(Impl::template vector<ColumnUInt8>( offset_column_data, nested_column, nested_null_map, res, null_map)); - } else if (check_column<ColumnInt16>(nested_column)) { + } else if (which_type.is_int16()) { static_cast<void>(Impl::template vector<ColumnInt16>( offset_column_data, nested_column, nested_null_map, res, null_map)); - } else if (check_column<ColumnInt32>(nested_column)) { + } else if (which_type.is_int32()) { static_cast<void>(Impl::template vector<ColumnInt32>( offset_column_data, nested_column, nested_null_map, res, null_map)); - } else if (check_column<ColumnInt64>(nested_column)) { + } else if (which_type.is_int64()) { static_cast<void>(Impl::template vector<ColumnInt64>( offset_column_data, nested_column, nested_null_map, res, null_map)); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org