This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 22955d1e5c0be545b0a698548e806653a05539cb
Author: amory <[email protected]>
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           | 32 +++----
 6 files changed, 138 insertions(+), 130 deletions(-)

diff --git a/be/src/vec/functions/array/function_array_difference.h 
b/be/src/vec/functions/array/function_array_difference.h
index 242d62adbf4..69d368d37a6 100644
--- a/be/src/vec/functions/array/function_array_difference.h
+++ b/be/src/vec/functions/array/function_array_difference.h
@@ -199,39 +199,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 c6cc27fbaf0..15e6d8891a0 100644
--- a/be/src/vec/functions/array/function_array_element.h
+++ b/be/src/vec/functions/array/function_array_element.h
@@ -279,7 +279,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);
     }
@@ -341,58 +341,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 f8d0a8b24df..b452ad911bc 100644
--- a/be/src/vec/functions/array/function_array_index.h
+++ b/be/src/vec/functions/array/function_array_index.h
@@ -337,55 +337,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);
@@ -393,19 +395,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 065f348fa8b..bf0a8b2b542 100644
--- a/be/src/vec/functions/array/function_array_remove.h
+++ b/be/src/vec/functions/array/function_array_remove.h
@@ -332,60 +332,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 969773481ac..05e553a6018 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 == Status::OK()) {
diff --git a/be/src/vec/functions/function_bitmap.cpp 
b/be/src/vec/functions/function_bitmap.cpp
index 7f90db70abd..1708911b3d0 100644
--- a/be/src/vec/functions/function_bitmap.cpp
+++ b/be/src/vec/functions/function_bitmap.cpp
@@ -379,21 +379,23 @@ 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)) {
-                Impl::template vector<ColumnInt8>(offset_column_data, 
nested_column,
-                                                  nested_null_map, res, 
null_map);
-            } else if (check_column<ColumnUInt8>(nested_column)) {
-                Impl::template vector<ColumnUInt8>(offset_column_data, 
nested_column,
-                                                   nested_null_map, res, 
null_map);
-            } else if (check_column<ColumnInt16>(nested_column)) {
-                Impl::template vector<ColumnInt16>(offset_column_data, 
nested_column,
-                                                   nested_null_map, res, 
null_map);
-            } else if (check_column<ColumnInt32>(nested_column)) {
-                Impl::template vector<ColumnInt32>(offset_column_data, 
nested_column,
-                                                   nested_null_map, res, 
null_map);
-            } else if (check_column<ColumnInt64>(nested_column)) {
-                Impl::template vector<ColumnInt64>(offset_column_data, 
nested_column,
-                                                   nested_null_map, res, 
null_map);
+
+            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 (which_type.is_uint8()) {
+                static_cast<void>(Impl::template vector<ColumnUInt8>(
+                        offset_column_data, nested_column, nested_null_map, 
res, null_map));
+            } 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 (which_type.is_int32()) {
+                static_cast<void>(Impl::template vector<ColumnInt32>(
+                        offset_column_data, nested_column, nested_null_map, 
res, null_map));
+            } 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 {
                 return Status::RuntimeError("Illegal column {} of argument of 
function {}",
                                             
block.get_by_position(arguments[0]).column->get_name(),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to