Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion be/src/common/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,17 @@

#include <fmt/format.h>

#include "util/uid_util.h"
#include <string>

namespace doris {

// TaggableLogger::tag only needs these declarations; TUs that actually log a
// TUniqueId/PUniqueId have the full types from their own includes.
class TUniqueId;
class PUniqueId;
std::string print_id(const TUniqueId& id);
std::string print_id(const PUniqueId& id);

// glog doesn't allow multiple invocations of InitGoogleLogging. This method conditionally
// calls InitGoogleLogging only if it hasn't been called before.
bool init_glog(const char* basename);
Expand Down
2 changes: 1 addition & 1 deletion be/src/core/column/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "core/string_ref.h"
#include "core/typeid_cast.h"
#include "core/types.h"
#include "storage/olap_common.h"
#include "storage/rowset_id.h"

namespace doris {
class SipHash;
Expand Down
2 changes: 1 addition & 1 deletion be/src/core/column/column_nullable.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "core/string_ref.h"
#include "core/typeid_cast.h"
#include "core/types.h"
#include "storage/olap_common.h"
#include "storage/rowset_id.h"

class SipHash;

Expand Down
2 changes: 1 addition & 1 deletion be/src/core/data_type/data_type_decimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "core/typeid_cast.h"
#include "core/types.h"
#include "exec/common/arithmetic_overflow.h"
#include "storage/olap_common.h"
#include "storage/field_type.h"

namespace doris {
class DecimalV2Value;
Expand Down
1 change: 1 addition & 0 deletions be/src/core/data_type/data_type_fixed_length_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "core/data_type_serde/data_type_string_serde.h"
#include "core/field.h"
#include "core/types.h"
#include "storage/field_type.h"

namespace doris {

Expand Down
1 change: 0 additions & 1 deletion be/src/core/data_type/data_type_ipv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "core/data_type_serde/data_type_ipv4_serde.h"
#include "core/pod_array.h"
#include "core/types.h"
#include "storage/olap_common.h"

namespace doris {
class BufferWritable;
Expand Down
1 change: 1 addition & 0 deletions be/src/core/data_type/data_type_nothing.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "core/data_type_serde/data_type_serde.h"
#include "core/field.h"
#include "core/types.h"
#include "storage/field_type.h"

namespace doris {

Expand Down
1 change: 1 addition & 0 deletions be/src/core/data_type/data_type_varbinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "core/data_type_serde/data_type_varbinary_serde.h"
#include "core/field.h"
#include "core/string_view.h"
#include "storage/field_type.h"

namespace doris {
class BufferWritable;
Expand Down
1 change: 1 addition & 0 deletions be/src/core/data_type/primitive_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "exec/common/template_helpers.hpp"

namespace doris {
class PathInData;
template <typename T>
class ColumnStr;
class IColumnDummy;
Expand Down
1 change: 1 addition & 0 deletions be/src/core/data_type_serde/data_type_array_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "core/data_type_serde/orc_serde_utils.h"
#include "core/string_ref.h"
#include "exprs/function/function_helpers.h"
#include "storage/field_type.h"
#include "util/jsonb_document.h"
#include "util/jsonb_writer.h"

Expand Down
1 change: 0 additions & 1 deletion be/src/core/data_type_serde/data_type_ipv4_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "core/string_ref.h"
#include "core/types.h"
#include "core/value/ipv4_value.h"
#include "storage/olap_common.h"

namespace doris {

Expand Down
1 change: 0 additions & 1 deletion be/src/core/data_type_serde/data_type_ipv6_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "core/string_ref.h"
#include "core/types.h"
#include "core/value/ipv6_value.h"
#include "storage/olap_common.h"

namespace doris {

Expand Down
2 changes: 1 addition & 1 deletion be/src/core/data_type_serde/data_type_number_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
#include "core/data_type/data_type.h"
#include "core/data_type/define_primitive_type.h"
#include "core/data_type_serde/data_type_serde.h"
#include "core/extended_types.h"
#include "core/field.h"
#include "core/string_ref.h"
#include "core/types.h"
#include "storage/olap_common.h"

namespace doris {
class JsonbOutStream;
Expand Down
1 change: 1 addition & 0 deletions be/src/core/data_type_serde/data_type_string_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "core/column/column_string.h"
#include "core/data_type_serde/data_type_serde.h"
#include "core/types.h"
#include "storage/field_type.h"

namespace doris {
class PValues;
Expand Down
13 changes: 11 additions & 2 deletions be/src/core/decimal12.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@

#pragma once

#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>

#include "storage/utils.h"
#include "common/status.h"

namespace doris {

Expand Down Expand Up @@ -118,7 +122,7 @@ struct decimal12_t {
(nullptr != sepr) ? MAX_FRAC_DIGITS_NUM - static_cast<int64_t>(strlen(sepr + 1))
: MAX_FRAC_DIGITS_NUM;
frac_len = frac_len > 0 ? frac_len : 0;
fraction *= g_power_table[frac_len];
fraction *= k_power_table[frac_len];
}

if (sign != nullptr) {
Expand All @@ -132,6 +136,11 @@ struct decimal12_t {
static const int32_t FRAC_RATIO = 1000000000;
static const int32_t MAX_INT_DIGITS_NUM = 18;
static const int32_t MAX_FRAC_DIGITS_NUM = 9;
// 10^0 .. 10^MAX_FRAC_DIGITS_NUM, used by from_string. A private copy so
// this header does not need storage/utils.h (whose g_power_table drags in
// the whole storage layer).
static constexpr int32_t k_power_table[MAX_FRAC_DIGITS_NUM + 1] = {
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};

int64_t integer;
int32_t fraction;
Expand Down
9 changes: 9 additions & 0 deletions be/src/core/extended_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,12 @@ struct IsArithmetic {

template <typename T>
inline constexpr bool IsArithmeticV = IsArithmetic<T>::value;

namespace doris {
// Canonical 128-bit integer aliases. They live here (not in a storage header)
// because bottom-of-the-world headers like core/packed_int128.h and
// util/coding.h must be able to name them without dragging in the storage
// layer; storage/olap_common.h re-exports them by including this header.
using int128_t = __int128;
using uint128_t = unsigned __int128;
} // namespace doris
1 change: 1 addition & 0 deletions be/src/core/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "core/value/timestamptz_value.h"
#include "core/value/vdatetime_value.h"
#include "exprs/function/cast/cast_to_string.h"
#include "util/json/path_in_data.h"
#include "util/var_int.h"

namespace doris {
Expand Down
4 changes: 3 additions & 1 deletion be/src/core/packed_int128.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

#pragma once

#include "storage/olap_common.h"
#include <cstring>

#include "core/extended_types.h"

namespace doris {

Expand Down
3 changes: 3 additions & 0 deletions be/src/core/value/variant/variant_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "core/field.h"
#include "core/value/variant/variant_parquet_encoding.h"
#include "core/value/variant/variant_scalar.h"
#include "util/json/path_in_data.h"
#include "util/utf8_check.h"

namespace doris {
Expand Down Expand Up @@ -285,6 +286,8 @@ void validate_variant_payload(VariantRef value) {
VariantField::VariantField(std::unique_ptr<char[]> data, size_t size) noexcept
: _data(std::move(data)), _size(size) {}

VariantField::VariantField() noexcept = default;

VariantField::~VariantField() = default;

VariantField::VariantField(VariantMap legacy)
Expand Down
6 changes: 4 additions & 2 deletions be/src/core/value/variant/variant_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

#include "core/string_ref.h"
#include "core/value/variant/variant_value.h"
#include "util/json/path_in_data.h"

namespace doris {

struct FieldWithDataType;
class PathInData;
class VariantScalarRef;
using VariantMap = std::map<PathInData, FieldWithDataType>;

Expand All @@ -43,7 +43,9 @@ void validate_variant_payload(VariantRef value);
// [u32 little-endian metadata_size][metadata][exactly one value].
class VariantField {
public:
VariantField() noexcept = default;
// Every special member lives in the .cpp: with PathInData forward-declared, any inline
// definition would instantiate the VariantMap destructor through the _legacy deleter.
VariantField() noexcept;
~VariantField();

VariantField(const VariantField& other);
Expand Down
1 change: 1 addition & 0 deletions be/src/exec/operator/schema_scan_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <gen_cpp/FrontendService_types.h>

#include <boost/algorithm/string.hpp>
#include <memory>

#include "core/column/column_nullable.h"
Expand Down
1 change: 1 addition & 0 deletions be/src/exprs/function/cast/cast_to_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "core/types.h"
#include "core/value/time_value.h"
#include "exprs/function/cast/cast_base.h"
#include "runtime/runtime_state.h"
#include "util/mysql_global.h"
#include "util/to_string.h"
namespace doris {
Expand Down
1 change: 1 addition & 0 deletions be/src/exprs/function/cast/cast_to_timestamptz.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "exprs/function/cast/cast_base.h"
#include "exprs/function/cast/cast_to_datetimev2_impl.hpp"
#include "exprs/function/cast/cast_to_timestamptz_impl.hpp"
#include "runtime/runtime_state.h"

namespace doris {

Expand Down
13 changes: 10 additions & 3 deletions be/src/exprs/function/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,22 @@
#include "core/data_type/data_type_struct.h"
#include "core/data_type/define_primitive_type.h"
#include "core/types.h"
#include "exprs/expr_zonemap_filter.h"
#include "exprs/function_context.h"
#include "exprs/vexpr_fwd.h"
#include "storage/index/inverted/inverted_index_iterator.h" // IWYU pragma: keep
#include "storage/index/inverted/inverted_index_parser.h"
#include "storage/index/zone_map/zonemap_filter_result.h"

namespace doris {
struct InvertedIndexAnalyzerCtx;
namespace expr_zonemap {
struct DictionaryEvalContext;
struct BloomFilterEvalContext;
} // namespace expr_zonemap
using DictionaryEvalContext = expr_zonemap::DictionaryEvalContext;
using BloomFilterEvalContext = expr_zonemap::BloomFilterEvalContext;
namespace segment_v2 {
class IndexIterator;
class InvertedIndexResultBitmap;
} // namespace segment_v2
} // namespace doris

namespace doris {
Expand Down
36 changes: 24 additions & 12 deletions be/src/exprs/function/function_encryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,30 @@ struct EncryptionAndDecryptMultiImpl {
auto& result_offset = result_column->get_offsets();
result_offset.resize(input_rows_count);

if ((arg_num == 5) && col_const[1] && col_const[2] && col_const[3] && col_const[4]) {
vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()),
argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0),
argument_columns[3]->get_data_at(0), input_rows_count, result_data,
result_offset, result_null_map_column->get_data(),
argument_columns[4]->get_data_at(0));
} else if ((arg_num == 4) && col_const[1] && col_const[2] && col_const[3]) {
vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()),
argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0),
argument_columns[3]->get_data_at(0), input_rows_count, result_data,
result_offset, result_null_map_column->get_data(), StringRef());
} else {
// if constexpr: the discarded arg_num instantiation must not index
// col_const[4] / argument_columns[4] out of bounds (-Warray-bounds).
bool all_params_const = false;
if constexpr (arg_num == 5) {
if (col_const[1] && col_const[2] && col_const[3] && col_const[4]) {
vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()),
argument_columns[1]->get_data_at(0),
argument_columns[2]->get_data_at(0),
argument_columns[3]->get_data_at(0), input_rows_count, result_data,
result_offset, result_null_map_column->get_data(),
argument_columns[4]->get_data_at(0));
all_params_const = true;
}
} else if constexpr (arg_num == 4) {
if (col_const[1] && col_const[2] && col_const[3]) {
vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()),
argument_columns[1]->get_data_at(0),
argument_columns[2]->get_data_at(0),
argument_columns[3]->get_data_at(0), input_rows_count, result_data,
result_offset, result_null_map_column->get_data(), StringRef());
all_params_const = true;
}
}
if (!all_params_const) {
std::vector<const ColumnString::Offsets*> offsets_list(argument_size);
std::vector<const ColumnString::Chars*> chars_list(argument_size);
for (size_t i = 0; i < argument_size; ++i) {
Expand Down
1 change: 1 addition & 0 deletions be/src/exprs/function/function_ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "exprs/function/function.h"
#include "exprs/function/function_helpers.h"
#include "storage/index/index_reader_helper.h"
#include "storage/index/inverted/inverted_index_iterator.h"

namespace doris {

Expand Down
1 change: 1 addition & 0 deletions be/src/exprs/function/functions_comparison.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "exprs/function/functions_logical.h"
#include "exprs/vexpr.h"
#include "storage/index/index_reader_helper.h"
#include "storage/index/inverted/inverted_index_iterator.h"

namespace doris {
/** Comparison functions: ==, !=, <, >, <=, >=.
Expand Down
1 change: 1 addition & 0 deletions be/src/exprs/function/is_not_null.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "exprs/expr_zonemap_filter.h"
#include "exprs/function/function.h"
#include "exprs/vslot_ref.h"
#include "storage/index/index_iterator.h"

namespace doris {
class FunctionContext;
Expand Down
1 change: 1 addition & 0 deletions be/src/exprs/function/is_null.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "exprs/expr_zonemap_filter.h"
#include "exprs/function/function.h"
#include "exprs/vslot_ref.h"
#include "storage/index/index_iterator.h"

namespace doris {
class FunctionContext;
Expand Down
1 change: 1 addition & 0 deletions be/src/exprs/vmatch_predicate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <gen_cpp/Exprs_types.h>
#include <glog/logging.h>

#include <boost/algorithm/string.hpp>
#include <memory>
#include <string>
#include <string_view>
Expand Down
1 change: 1 addition & 0 deletions be/src/format_v2/file_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "gen_cpp/PlanNodes_types.h"
#include "io/file_factory.h"
#include "io/fs/file_reader_writer_fwd.h"
#include "io/io_common.h"

namespace doris {
class Block;
Expand Down
1 change: 1 addition & 0 deletions be/src/io/fs/tracing_file_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#pragma once
#include "common/status.h"
#include "io/fs/file_reader.h"
#include "io/io_common.h"
#include "runtime/runtime_profile.h"

namespace doris {
Expand Down
1 change: 0 additions & 1 deletion be/src/pch/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,4 +527,3 @@
#include "common/config.h"
#include "common/status.h"
#include "common/version_internal.h"
#include "storage/olap_common.h"
Loading
Loading