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
34 changes: 0 additions & 34 deletions be/src/core/binary_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,12 @@
#include "core/value/vdatetime_value.h"

namespace doris {
union TypeConverter {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing these union helpers breaks the benchmark target. be/benchmark/benchmark_main.cpp still includes binary_cast_benchmark.hpp, and that header's old_binary_cast() still references TypeConverter, VecDateTimeInt64Union, DateV2UInt32Union, DateTimeV2UInt64Union, and DecimalInt128Union. Since be/CMakeLists.txt builds this file when BUILD_BENCHMARK is enabled, -DBUILD_BENCHMARK=ON will no longer compile. Please either update/remove the benchmark's old implementation or keep local benchmark-only definitions.

uint64_t u64;
int64_t i64;
uint32_t u32[2];
int32_t i32[2];
uint8_t u8[8];
float flt[2];
double dbl;
};

template <typename C0, typename C1, typename T0, typename T1>
constexpr bool match_v = std::is_same_v<C0, C1> && std::is_same_v<T0, T1>;

union DecimalInt128Union {
DecimalV2Value decimal;
PackedInt128 packed128;
__int128_t i128;
};

static_assert(sizeof(DecimalV2Value) == sizeof(PackedInt128));
static_assert(sizeof(DecimalV2Value) == sizeof(__int128_t));

union VecDateTimeInt64Union {
doris::VecDateTimeValue dt;
__int64_t i64;
~VecDateTimeInt64Union() {}
};

union DateV2UInt32Union {
DateV2Value<DateV2ValueType> dt;
uint32_t ui32;
~DateV2UInt32Union() {}
};

union DateTimeV2UInt64Union {
DateV2Value<DateTimeV2ValueType> dt;
uint64_t ui64;
~DateTimeV2UInt64Union() {}
};

// similar to reinterpret_cast but won't break strict-aliasing rules. you can treat it as std::bit_cast with type checking
template <typename From, typename To>
constexpr PURE To binary_cast(const From& from) {
Expand Down
33 changes: 0 additions & 33 deletions be/src/core/block/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@
#include <glog/logging.h>
#include <snappy.h>
#include <streamvbyte.h>
#include <sys/types.h>

#include <algorithm>
#include <cassert>
#include <iomanip>
#include <iterator>
#include <limits>
#include <ranges>

#include "agent/be_exec_version_manager.h"
#include "common/compiler_util.h" // IWYU pragma: keep
#include "common/config.h"
#include "common/logging.h"
#include "common/status.h"
#include "core/assert_cast.h"
Expand Down Expand Up @@ -353,25 +350,6 @@ size_t Block::bytes() const {
return res;
}

std::string Block::columns_bytes() const {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation is removed, but be/src/core/block/block.h still declares std::string columns_bytes() const;. That leaves a public Block API with no definition, so any caller that includes the header and calls this method will fail at link time. Please remove the declaration as well, or keep the definition if the API should remain available.

std::stringstream res;
res << "column bytes: [";
for (const auto& elem : data) {
if (!elem.column) {
std::stringstream ss;
for (const auto& e : data) {
ss << e.name + " ";
}
throw Exception(ErrorCode::INTERNAL_ERROR,
"Column {} in block is nullptr, in method bytes. All Columns are {}",
elem.name, ss.str());
}
res << ", " << elem.column->byte_size();
}
res << "]";
return res.str();
}

size_t Block::allocated_bytes() const {
size_t res = 0;
for (const auto& elem : data) {
Expand Down Expand Up @@ -619,17 +597,6 @@ void Block::set_columns(MutableColumns&& columns) {
}
}

Block Block::clone_with_columns(MutableColumns&& columns) const {
Block res;

size_t num_columns = data.size();
for (size_t i = 0; i < num_columns; ++i) {
res.insert({std::move(columns[i]), data[i].type, data[i].name});
}

return res;
}

Block Block::clone_without_columns(const std::vector<int>* column_offset) const {
Block res;

Expand Down
2 changes: 0 additions & 2 deletions be/src/core/block/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ class Block {

/** Replace columns in a block */
void set_columns(MutableColumns&& columns);
Block clone_with_columns(MutableColumns&& columns) const;

void clear();
void swap(Block& other) noexcept;
void swap(Block&& other) noexcept;
Expand Down
2 changes: 0 additions & 2 deletions be/src/core/call_on_type_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class DataTypeDateTime;
class DataTypeIPv4;
class DataTypeIPv6;
class DataTypeString;
template <typename T>
class DataTypeEnum;
template <PrimitiveType T>
class DataTypeNumber;
template <PrimitiveType T>
Expand Down
15 changes: 0 additions & 15 deletions be/src/core/column/column_variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,6 @@ ColumnVariant::Subcolumn ColumnVariant::Subcolumn::clone_with_default_values(
return new_subcolumn;
}

Field ColumnVariant::Subcolumn::get_last_field() const {
if (data.empty()) {
return Field();
}

const auto& last_part = data.back();
assert(!last_part->empty());
return (*last_part)[last_part->size() - 1];
}

void ColumnVariant::Subcolumn::insert_range_from(const Subcolumn& src, size_t start,
size_t length) {
if (start + length > src.size()) {
Expand Down Expand Up @@ -2676,9 +2666,4 @@ MutableColumnPtr ColumnVariant::clone() const {
return res;
}

bool ColumnVariant::is_doc_mode() const {
const auto& offset = serialized_doc_value_column_offsets();
return subcolumns.size() == 1 && offset[num_rows - 1] != 0;
}

} // namespace doris
6 changes: 0 additions & 6 deletions be/src/core/column/column_variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ class ColumnVariant final : public COWHelper<IColumn, ColumnVariant> {
/// creates a single column that stores all values.
void finalize(FinalizeMode mode = FinalizeMode::READ_MODE);

/// Returns last inserted field.
Field get_last_field() const;

void deserialize_from_binary_column(const ColumnString* value, size_t row);

/// Returns single column if subcolumn in finalizes.
Expand Down Expand Up @@ -640,9 +637,6 @@ class ColumnVariant final : public COWHelper<IColumn, ColumnVariant> {
return _max_subcolumns_count - current_subcolumns_count;
}

// doc snapshot mode: only root column, and doc snapshot column is not empty
bool is_doc_mode() const;

void try_get_from_doc_value_column(size_t n, Field& res) const;

void insert_to_doc_value_column(const Field& field);
Expand Down
5 changes: 0 additions & 5 deletions be/src/core/data_type/nested_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ std::pair<std::string, std::string> splitName(const std::string& name) {
return {{begin, first_end}, {second_begin, end}};
}

std::string extract_table_name(const std::string& nested_name) {
auto splitted = splitName(nested_name);
return splitted.first;
}

} // namespace Nested

} // namespace doris
6 changes: 0 additions & 6 deletions be/src/core/data_type/nested_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,8 @@ std::string concatenate_name(const std::string& nested_table_name,

std::pair<std::string, std::string> splitName(const std::string& name);

/// Returns the prefix of the name to the first '.'. Or the name is unchanged if there is no dot.
std::string extract_table_name(const std::string& nested_name);

/// Replace Array(Tuple(...)) columns to a multiple of Array columns in a form of `column_name.element_name`.
Block flatten(const Block& block);

/// Check that sizes of arrays - elements of nested data structures - are equal.
void validate_array_sizes(const Block& block);
} // namespace Nested

} // namespace doris
84 changes: 0 additions & 84 deletions be/src/core/data_type/number_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@
#include <climits>
#include <type_traits>

#include "core/column/column_decimal.h"
#include "core/column/column_vector.h"
#include "core/extended_types.h"
#include "core/types.h"
#include "core/uint128.h"

namespace doris {

Expand Down Expand Up @@ -143,68 +140,6 @@ struct Construct<true, true, 16> {
static constexpr PrimitiveType Type = TYPE_DOUBLE;
};

/** The result of addition or multiplication is calculated according to the following rules:
* - if one of the arguments is floating-point, the result is a floating point, otherwise - the whole;
* - if one of the arguments is signed, the result is signed, otherwise it is unsigned;
* - the result contains more bits (not only meaningful) than the maximum in the arguments
* (for example, UInt8 + Int32 = Int64).
*/
template <typename A, typename B>
struct ResultOfAdditionMultiplication {
static constexpr PrimitiveType Type = Construct < IsSignedV<A> || IsSignedV<B>,
std::is_floating_point_v<A> || std::is_floating_point_v<B>,
next_size(max(sizeof(A), sizeof(B))) > ::Type;
};

template <typename A, typename B>
struct ResultOfSubtraction {
static constexpr PrimitiveType Type = Construct < true,
std::is_floating_point_v<A> || std::is_floating_point_v<B>,
next_size(max(sizeof(A), sizeof(B))) > ::Type;
};

/** When dividing, you always get a floating-point number.
*/
template <typename A, typename B>
struct ResultOfFloatingPointDivision {
struct DoubleField {
static constexpr PrimitiveType PType = TYPE_DOUBLE;
};
static constexpr PrimitiveType Type =
std::conditional_t<IsDecimalNumber<A>, A,
std::conditional_t<IsDecimalNumber<B>, B, DoubleField>>::PType;
};

/** For integer division, we get a number with the same number of bits as in divisible.
*/
template <typename A, typename B>
struct ResultOfIntegerDivision {
static constexpr PrimitiveType Type = Construct < IsSignedV<A> || IsSignedV<B>, false,
sizeof(A) > ::Type;
};

/** Division with remainder you get a number with the same number of bits as in divisor.
*/
template <typename A, typename B>
struct ResultOfModulo {
constexpr static auto has_float = std::is_floating_point_v<A> || std::is_floating_point_v<B>;
consteval static auto result_size() {
if constexpr (!has_float) {
return max(sizeof(A), sizeof(B));
}
size_t max_float_size = 0;
if constexpr (std::is_floating_point_v<A>) {
max_float_size = max(max_float_size, sizeof(A));
}
if constexpr (std::is_floating_point_v<B>) {
max_float_size = max(max_float_size, sizeof(B));
}
return max_float_size;
}
static constexpr PrimitiveType Type = Construct < IsSignedV<A> || IsSignedV<B>, has_float,
result_size() > ::Type;
};

template <typename A>
struct ResultOfAbs {
static constexpr PrimitiveType Type =
Expand Down Expand Up @@ -237,30 +172,11 @@ struct ResultOfAbs<Decimal128V3> {
static constexpr PrimitiveType Type = TYPE_DECIMAL128I;
};

/** For bitwise operations, an integer is obtained with number of bits is equal to the maximum of the arguments.
*/
template <typename A, typename B>
struct ResultOfBit {
static constexpr PrimitiveType Type = Construct < IsSignedV<A> || IsSignedV<B>, false,
std::is_floating_point_v<A> || std::is_floating_point_v<B>
? 8
: max(sizeof(A), sizeof(B)) > ::Type;
};

template <typename A>
struct ResultOfBitNot {
static constexpr PrimitiveType Type = Construct<IsSignedV<A>, false, sizeof(A)>::Type;
};

template <PrimitiveType A, PrimitiveType B>
struct BinaryOperatorTraits {
using ColumnVectorA = typename PrimitiveTypeTraits<A>::ColumnType;
using ColumnVectorB = typename PrimitiveTypeTraits<B>::ColumnType;
using ArrayA = typename ColumnVectorA::Container;
using ArrayB = typename ColumnVectorB::Container;
using ArrayNull = PaddedPODArray<UInt8>;
};

template <typename T>
/// Returns the maximum ascii string length for this type.
/// e.g. the max/min int8_t has 3 characters.
Expand Down
1 change: 0 additions & 1 deletion be/src/core/data_type_serde/data_type_array_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
namespace doris {
class PValues;
struct JsonbValue;
class JsonWriter;

class IColumn;
class Arena;
Expand Down
13 changes: 0 additions & 13 deletions be/src/core/string_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,6 @@ StringRef StringRef::max_string_val() {
return StringRef((char*)(&StringRef::MAX_CHAR), 1);
}

bool StringRef::start_with(char ch) const {
if (UNLIKELY(size == 0)) {
return false;
}
return data[0] == ch;
}
bool StringRef::end_with(char ch) const {
if (UNLIKELY(size == 0)) {
return false;
}
return data[size - 1] == ch;
}

bool StringRef::start_with(const StringRef& search_string) const {
if (search_string.size == 0) {
return true;
Expand Down
2 changes: 0 additions & 2 deletions be/src/core/string_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ struct StringRef {
static StringRef min_string_val();
static StringRef max_string_val();

bool start_with(char) const;
bool end_with(char) const;
bool start_with(const StringRef& search_string) const;
bool end_with(const StringRef& search_string) const;

Expand Down
29 changes: 0 additions & 29 deletions be/src/core/value/map_value.cpp

This file was deleted.

2 changes: 0 additions & 2 deletions be/src/core/value/map_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class MapValue {

int32_t length() const { return _length; }

void shallow_copy(const MapValue* other);

const void* key_data() const { return _key_data; }
void* mutable_key_data() const { return _key_data; }
const void* value_data() const { return _value_data; }
Expand Down
Loading
Loading