diff --git a/be/src/util/debug_points.h b/be/src/util/debug_points.h index b28bdae86f1ac6b..1106a548f8d928b 100644 --- a/be/src/util/debug_points.h +++ b/be/src/util/debug_points.h @@ -29,12 +29,12 @@ #include "fmt/format.h" // more usage can see 'util/debug_points_test.cpp' -#define DBUG_EXECUTE_IF(debug_point_name, code) \ - if (UNLIKELY(config::enable_debug_points)) { \ - auto dp = DebugPoints::instance() -> get_debug_point(debug_point_name); \ - if (dp) { \ - code; \ - } \ +#define DBUG_EXECUTE_IF(debug_point_name, code) \ + if (UNLIKELY(config::enable_debug_points)) { \ + auto dp = DebugPoints::instance()->get_debug_point(debug_point_name); \ + if (dp) { \ + code; \ + } \ } namespace doris { diff --git a/be/src/vec/functions/function_bitmap_variadic.cpp b/be/src/vec/functions/function_bitmap_variadic.cpp index a2fdffcea620f1d..321da1a06015518 100644 --- a/be/src/vec/functions/function_bitmap_variadic.cpp +++ b/be/src/vec/functions/function_bitmap_variadic.cpp @@ -52,67 +52,67 @@ namespace doris::vectorized { // currently only bitmap_or and bitmap_or_count will call this function, // other bitmap functions will use default implementation for nulls -#define BITMAP_OR_NULLABLE(nullable, input_rows_count, res, op) \ - const auto& nested_col_ptr = nullable->get_nested_column_ptr(); \ - const auto* __restrict null_map_data = nullable->get_null_map_data().data(); \ - const auto& mid_data = assert_cast(nested_col_ptr.get()) -> get_data(); \ - for (size_t row = 0; row < input_rows_count; ++row) { \ - if (!null_map_data[row]) { \ - res[row] op mid_data[row]; \ - } \ +#define BITMAP_OR_NULLABLE(nullable, input_rows_count, res, op) \ + const auto& nested_col_ptr = nullable->get_nested_column_ptr(); \ + const auto* __restrict null_map_data = nullable->get_null_map_data().data(); \ + const auto& mid_data = assert_cast(nested_col_ptr.get())->get_data(); \ + for (size_t row = 0; row < input_rows_count; ++row) { \ + if (!null_map_data[row]) { \ + res[row] op mid_data[row]; \ + } \ } -#define BITMAP_FUNCTION_VARIADIC(CLASS, FUNCTION_NAME, OP) \ - struct CLASS { \ - static constexpr auto name = #FUNCTION_NAME; \ - using ResultDataType = DataTypeBitMap; \ - static Status vector_vector(ColumnPtr argument_columns[], size_t col_size, \ - size_t input_rows_count, std::vector& res, \ - IColumn* res_nulls) { \ - const ColumnUInt8::value_type* null_map_datas[col_size]; \ - int nullable_cols_count = 0; \ - ColumnUInt8::value_type* __restrict res_nulls_data = nullptr; \ - if (res_nulls) { \ - res_nulls_data = assert_cast(res_nulls)->get_data().data(); \ - } \ - if (auto* nullable = check_and_get_column(*argument_columns[0])) { \ - null_map_datas[nullable_cols_count++] = nullable->get_null_map_data().data(); \ - BITMAP_OR_NULLABLE(nullable, input_rows_count, res, =); \ - } else { \ - const auto& mid_data = \ - assert_cast(argument_columns[0].get()) -> get_data(); \ - for (size_t row = 0; row < input_rows_count; ++row) { \ - res[row] = mid_data[row]; \ - } \ - } \ - for (size_t col = 1; col < col_size; ++col) { \ - if (auto* nullable = \ - check_and_get_column(*argument_columns[col])) { \ - null_map_datas[nullable_cols_count++] = nullable->get_null_map_data().data(); \ - BITMAP_OR_NULLABLE(nullable, input_rows_count, res, OP); \ - } else { \ - const auto& col_data = \ - assert_cast(argument_columns[col].get()) \ - -> get_data(); \ - for (size_t row = 0; row < input_rows_count; ++row) { \ - res[row] OP col_data[row]; \ - } \ - } \ - } \ - if (res_nulls_data && nullable_cols_count == col_size) { \ - const auto* null_map_data = null_map_datas[0]; \ - for (size_t row = 0; row < input_rows_count; ++row) { \ - res_nulls_data[row] = null_map_data[row]; \ - } \ - for (int i = 1; i < nullable_cols_count; ++i) { \ - const auto* null_map_data = null_map_datas[i]; \ - for (size_t row = 0; row < input_rows_count; ++row) { \ - res_nulls_data[row] &= null_map_data[row]; \ - } \ - } \ - } \ - return Status::OK(); \ - } \ +#define BITMAP_FUNCTION_VARIADIC(CLASS, FUNCTION_NAME, OP) \ + struct CLASS { \ + static constexpr auto name = #FUNCTION_NAME; \ + using ResultDataType = DataTypeBitMap; \ + static Status vector_vector(ColumnPtr argument_columns[], size_t col_size, \ + size_t input_rows_count, std::vector& res, \ + IColumn* res_nulls) { \ + const ColumnUInt8::value_type* null_map_datas[col_size]; \ + int nullable_cols_count = 0; \ + ColumnUInt8::value_type* __restrict res_nulls_data = nullptr; \ + if (res_nulls) { \ + res_nulls_data = assert_cast(res_nulls)->get_data().data(); \ + } \ + if (auto* nullable = check_and_get_column(*argument_columns[0])) { \ + null_map_datas[nullable_cols_count++] = nullable->get_null_map_data().data(); \ + BITMAP_OR_NULLABLE(nullable, input_rows_count, res, =); \ + } else { \ + const auto& mid_data = \ + assert_cast(argument_columns[0].get())->get_data(); \ + for (size_t row = 0; row < input_rows_count; ++row) { \ + res[row] = mid_data[row]; \ + } \ + } \ + for (size_t col = 1; col < col_size; ++col) { \ + if (auto* nullable = \ + check_and_get_column(*argument_columns[col])) { \ + null_map_datas[nullable_cols_count++] = nullable->get_null_map_data().data(); \ + BITMAP_OR_NULLABLE(nullable, input_rows_count, res, OP); \ + } else { \ + const auto& col_data = \ + assert_cast(argument_columns[col].get()) \ + ->get_data(); \ + for (size_t row = 0; row < input_rows_count; ++row) { \ + res[row] OP col_data[row]; \ + } \ + } \ + } \ + if (res_nulls_data && nullable_cols_count == col_size) { \ + const auto* null_map_data = null_map_datas[0]; \ + for (size_t row = 0; row < input_rows_count; ++row) { \ + res_nulls_data[row] = null_map_data[row]; \ + } \ + for (int i = 1; i < nullable_cols_count; ++i) { \ + const auto* null_map_data = null_map_datas[i]; \ + for (size_t row = 0; row < input_rows_count; ++row) { \ + res_nulls_data[row] &= null_map_data[row]; \ + } \ + } \ + } \ + return Status::OK(); \ + } \ } #define BITMAP_FUNCTION_COUNT_VARIADIC(CLASS, FUNCTION_NAME, OP) \ @@ -137,7 +137,7 @@ namespace doris::vectorized { } else { \ const auto& col_data = \ assert_cast(argument_columns[col].get()) \ - -> get_data(); \ + ->get_data(); \ for (size_t row = 0; row < input_rows_count; ++row) { \ vals[row] OP col_data[row]; \ } \