Skip to content
Merged
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
8 changes: 4 additions & 4 deletions be/src/exprs/function_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace doris {

class FunctionFilter {
public:
FunctionFilter(bool opposite, const std::string& col_name, doris_udf::FunctionContext* fn_ctx,
doris_udf::StringVal string_param)
FunctionFilter(bool opposite, const std::string& col_name, doris::FunctionContext* fn_ctx,
doris::StringVal string_param)
: _opposite(opposite),
_col_name(col_name),
_fn_ctx(fn_ctx),
Expand All @@ -35,8 +35,8 @@ class FunctionFilter {
bool _opposite;
std::string _col_name;
// these pointer's life time controlled by scan node
doris_udf::FunctionContext* _fn_ctx;
doris_udf::StringVal
doris::FunctionContext* _fn_ctx;
doris::StringVal
_string_param; // only one param from conjunct, because now only support like predicate
};

Expand Down
2 changes: 0 additions & 2 deletions be/src/exprs/json_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ struct JsonPath {
}
};

using namespace doris_udf;

class JsonFunctions {
public:
/**
Expand Down
4 changes: 2 additions & 2 deletions be/src/exprs/math_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class MathFunctions {

// Converts src_num in decimal to dest_base,
// and fills expr_val.string_val with the result.
static doris_udf::StringVal decimal_to_base(doris_udf::FunctionContext* ctx, int64_t src_num,
int8_t dest_base);
static doris::StringVal decimal_to_base(doris::FunctionContext* ctx, int64_t src_num,
int8_t dest_base);

// Converts src_num representing a number in src_base but encoded in decimal
// into its actual decimal number.
Expand Down
2 changes: 1 addition & 1 deletion be/src/exprs/string_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace doris {

class StringFunctions {
public:
static bool set_re2_options(const doris_udf::StringVal& match_parameter, std::string* error_str,
static bool set_re2_options(const doris::StringVal& match_parameter, std::string* error_str,
re2::RE2::Options* opts);

// The caller owns the returned regex. Returns nullptr if the pattern could not be compiled.
Expand Down
11 changes: 5 additions & 6 deletions be/src/olap/like_column_predicate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,20 @@ namespace doris {

template <>
LikeColumnPredicate<true>::LikeColumnPredicate(bool opposite, uint32_t column_id,
doris_udf::FunctionContext* fn_ctx,
doris_udf::StringVal val)
doris::FunctionContext* fn_ctx, doris::StringVal val)
: ColumnPredicate(column_id, opposite), pattern(reinterpret_cast<char*>(val.ptr), val.len) {
_state = reinterpret_cast<StateType*>(
fn_ctx->get_function_state(doris_udf::FunctionContext::THREAD_LOCAL));
fn_ctx->get_function_state(doris::FunctionContext::THREAD_LOCAL));
_state->search_state.clone(_like_state);
}

template <>
LikeColumnPredicate<false>::LikeColumnPredicate(bool opposite, uint32_t column_id,
doris_udf::FunctionContext* fn_ctx,
doris_udf::StringVal val)
doris::FunctionContext* fn_ctx,
doris::StringVal val)
: ColumnPredicate(column_id, opposite), pattern(val) {
_state = reinterpret_cast<StateType*>(
fn_ctx->get_function_state(doris_udf::FunctionContext::THREAD_LOCAL));
fn_ctx->get_function_state(doris::FunctionContext::THREAD_LOCAL));
}

template <bool is_vectorized>
Expand Down
4 changes: 2 additions & 2 deletions be/src/olap/like_column_predicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace doris {
template <bool is_vectorized>
class LikeColumnPredicate : public ColumnPredicate {
public:
LikeColumnPredicate(bool opposite, uint32_t column_id, doris_udf::FunctionContext* fn_ctx,
doris_udf::StringVal val);
LikeColumnPredicate(bool opposite, uint32_t column_id, doris::FunctionContext* fn_ctx,
doris::StringVal val);
~LikeColumnPredicate() override = default;

PredicateType type() const override { return PredicateType::EQ; }
Expand Down
25 changes: 0 additions & 25 deletions be/src/olap/olap_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ static const uint64_t GB_EXCHANGE_BYTE = 1024 * 1024 * 1024;
// bloom filter fpp
static const double BLOOM_FILTER_DEFAULT_FPP = 0.05;

#define OLAP_GOTO(label) goto label

enum ColumnFamilyIndex {
DEFAULT_COLUMN_FAMILY_INDEX = 0,
DORIS_COLUMN_FAMILY_INDEX,
Expand Down Expand Up @@ -186,29 +184,6 @@ const std::string REMOTE_TABLET_GC_PREFIX = "tgc_";
type_t(const type_t&);
#endif

// 没有使用的变量不报warning
#define OLAP_UNUSED_ARG(a) (void)(a)

// thread-safe(gcc only) method for obtaining singleton
#define DECLARE_SINGLETON(classname) \
public: \
static classname* instance() { \
classname* p_instance = nullptr; \
try { \
static classname s_instance; \
p_instance = &s_instance; \
} catch (...) { \
p_instance = nullptr; \
} \
return p_instance; \
} \
\
protected: \
classname(); \
\
private: \
~classname();

#define SAFE_DELETE(ptr) \
do { \
if (nullptr != ptr) { \
Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/rowset/beta_rowset_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ BetaRowsetWriter::~BetaRowsetWriter() {
* when the job is cancelled. Although it is meaningless to continue segcompaction when the job
* is cancelled, the objects involved in the job should be preserved during segcompaction to
* avoid crashs for memory issues. */
OLAP_UNUSED_ARG(_wait_flying_segcompaction());
_wait_flying_segcompaction();

// TODO(lingbin): Should wrapper exception logic, no need to know file ops directly.
if (!_already_built) { // abnormal exit, remove all files generated
Expand Down
2 changes: 2 additions & 0 deletions be/src/runtime/buffer_control_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

#include "gen_cpp/PaloInternalService_types.h"
#include "gen_cpp/internal_service.pb.h"
#include "runtime/exec_env.h"
#include "runtime/raw_value.h"
#include "runtime/thread_context.h"
#include "service/brpc.h"
#include "util/thrift_util.h"

Expand Down
6 changes: 3 additions & 3 deletions be/src/runtime/collection_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

#include "runtime/primitive_type.h"

namespace doris_udf {
namespace doris {
class FunctionContext;
} // namespace doris_udf
} // namespace doris

namespace doris {

using doris_udf::FunctionContext;
using doris::FunctionContext;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: using decl 'FunctionContext' is unused [misc-unused-using-decls]

using doris::FunctionContext;
             ^

be/src/runtime/collection_value.h:29: remove the using

using doris::FunctionContext;
             ^


using MemFootprint = std::pair<int64_t, uint8_t*>;
using GenMemFootprintFunc = std::function<MemFootprint(int64_t size)>;
Expand Down
4 changes: 2 additions & 2 deletions be/src/runtime/datetime_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,12 @@ class DateTimeValue {

DateTimeValue& operator--() { return *this += -1; }

void to_datetime_val(doris_udf::DateTimeVal* tv) const {
void to_datetime_val(doris::DateTimeVal* tv) const {
tv->packed_time = to_int64_datetime_packed();
tv->type = _type;
}

static DateTimeValue from_datetime_val(const doris_udf::DateTimeVal& tv) {
static DateTimeValue from_datetime_val(const doris::DateTimeVal& tv) {
DateTimeValue value;
value.from_packed_time(tv.packed_time);
if (tv.type == TIME_DATE) {
Expand Down
2 changes: 0 additions & 2 deletions be/src/runtime/decimalv2_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ enum DecimalError {

enum DecimalRoundMode { HALF_UP = 1, HALF_EVEN = 2, CEILING = 3, FLOOR = 4, TRUNCATE = 5 };

using namespace doris_udf;

class DecimalV2Value {
public:
friend DecimalV2Value operator+(const DecimalV2Value& v1, const DecimalV2Value& v2);
Expand Down
9 changes: 2 additions & 7 deletions be/src/runtime/descriptor_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,11 @@ class TTupleDescriptorBuilder {
}
}
int null_bytes = (num_nullables + 7) / 8;
int offset = null_bytes;
int null_offset = 0;
for (int i = 0; i < _slot_descs.size(); ++i) {
auto& slot_desc = _slot_descs[i];
int size = get_slot_size(thrift_to_type(slot_desc.slotType.types[0].scalar_type.type));
int align = (size > 16) ? 16 : size;
offset = ((offset + align - 1) / align) * align;
slot_desc.id = tb->next_slot_id();
slot_desc.parent = _tuple_id;
slot_desc.byteOffset = offset;
offset += size;
if (slot_desc.nullIndicatorByte >= 0) {
slot_desc.nullIndicatorBit = null_offset % 8;
slot_desc.nullIndicatorByte = null_offset / 8;
Expand All @@ -140,7 +134,8 @@ class TTupleDescriptorBuilder {
}

_tuple_desc.id = _tuple_id;
_tuple_desc.byteSize = offset;
// Useless not set it.
_tuple_desc.byteSize = 0;
_tuple_desc.numNullBytes = null_bytes;
_tuple_desc.numNullSlots = _slot_descs.size();

Expand Down
50 changes: 5 additions & 45 deletions be/src/runtime/descriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ SlotDescriptor::SlotDescriptor(const TSlotDescriptor& tdesc)
_type(TypeDescriptor::from_thrift(tdesc.slotType)),
_parent(tdesc.parent),
_col_pos(tdesc.columnPos),
_tuple_offset(tdesc.byteOffset),
_null_indicator_offset(tdesc.nullIndicatorByte, tdesc.nullIndicatorBit),
_col_name(tdesc.colName),
_col_name_lower_case(to_lower(tdesc.colName)),
_col_unique_id(tdesc.col_unique_id),
_slot_idx(tdesc.slotIdx),
_slot_size(_type.get_slot_size()),
_field_idx(-1),
_is_materialized(tdesc.isMaterialized),
_is_key(tdesc.is_key),
Expand All @@ -72,13 +70,11 @@ SlotDescriptor::SlotDescriptor(const PSlotDescriptor& pdesc)
_type(TypeDescriptor::from_protobuf(pdesc.slot_type())),
_parent(pdesc.parent()),
_col_pos(pdesc.column_pos()),
_tuple_offset(pdesc.byte_offset()),
_null_indicator_offset(pdesc.null_indicator_byte(), pdesc.null_indicator_bit()),
_col_name(pdesc.col_name()),
_col_name_lower_case(to_lower(pdesc.col_name())),
_col_unique_id(pdesc.col_unique_id()),
_slot_idx(pdesc.slot_idx()),
_slot_size(_type.get_slot_size()),
_field_idx(-1),
_is_materialized(pdesc.is_materialized()),
_is_key(pdesc.is_key()),
Expand All @@ -89,7 +85,7 @@ void SlotDescriptor::to_protobuf(PSlotDescriptor* pslot) const {
pslot->set_parent(_parent);
_type.to_protobuf(pslot->mutable_slot_type());
pslot->set_column_pos(_col_pos);
pslot->set_byte_offset(_tuple_offset);
pslot->set_byte_offset(0);
pslot->set_null_indicator_byte(_null_indicator_offset.byte_offset);
pslot->set_null_indicator_bit(_null_indicator_offset.bit_offset);
DCHECK_LE(_null_indicator_offset.bit_offset, 8);
Expand All @@ -115,8 +111,7 @@ vectorized::DataTypePtr SlotDescriptor::get_data_type_ptr() const {
std::string SlotDescriptor::debug_string() const {
std::stringstream out;
out << "Slot(id=" << _id << " type=" << _type << " col=" << _col_pos
<< ", colname=" << _col_name << " offset=" << _tuple_offset
<< " null=" << _null_indicator_offset.debug_string() << ")";
<< ", colname=" << _col_name << " null=" << _null_indicator_offset.debug_string() << ")";
return out.str();
}

Expand Down Expand Up @@ -256,7 +251,6 @@ std::string JdbcTableDescriptor::debug_string() const {
TupleDescriptor::TupleDescriptor(const TTupleDescriptor& tdesc, bool own_slots)
: _id(tdesc.id),
_table_desc(nullptr),
_byte_size(tdesc.byteSize),
_num_null_bytes(tdesc.numNullBytes),
_num_materialized_slots(0),
_slots(),
Expand All @@ -273,7 +267,6 @@ TupleDescriptor::TupleDescriptor(const TTupleDescriptor& tdesc, bool own_slots)
TupleDescriptor::TupleDescriptor(const PTupleDescriptor& pdesc, bool own_slots)
: _id(pdesc.id()),
_table_desc(nullptr),
_byte_size(pdesc.byte_size()),
_num_null_bytes(pdesc.num_null_bytes()),
_num_materialized_slots(0),
_slots(),
Expand Down Expand Up @@ -313,30 +306,19 @@ std::vector<SlotDescriptor*> TupleDescriptor::slots_ordered_by_idx() const {
return sorted_slots;
}

bool TupleDescriptor::layout_equals(const TupleDescriptor& other_desc) const {
if (byte_size() != other_desc.byte_size()) return false;
if (slots().size() != other_desc.slots().size()) return false;

std::vector<SlotDescriptor*> slots = slots_ordered_by_idx();
std::vector<SlotDescriptor*> other_slots = other_desc.slots_ordered_by_idx();
for (int i = 0; i < slots.size(); ++i) {
if (!slots[i]->layout_equals(*other_slots[i])) return false;
}
return true;
}

void TupleDescriptor::to_protobuf(PTupleDescriptor* ptuple) const {
ptuple->Clear();
ptuple->set_id(_id);
ptuple->set_byte_size(_byte_size);
// Useless not set
ptuple->set_byte_size(0);
ptuple->set_num_null_bytes(_num_null_bytes);
ptuple->set_table_id(-1);
ptuple->set_num_null_slots(_num_null_slots);
}

std::string TupleDescriptor::debug_string() const {
std::stringstream out;
out << "Tuple(id=" << _id << " size=" << _byte_size;
out << "Tuple(id=" << _id;
if (_table_desc != nullptr) {
//out << " " << _table_desc->debug_string();
}
Expand Down Expand Up @@ -501,19 +483,6 @@ bool RowDescriptor::equals(const RowDescriptor& other_desc) const {
return true;
}

bool RowDescriptor::layout_is_prefix_of(const RowDescriptor& other_desc) const {
if (_tuple_desc_map.size() > other_desc._tuple_desc_map.size()) return false;
for (int i = 0; i < _tuple_desc_map.size(); ++i) {
if (!_tuple_desc_map[i]->layout_equals(*other_desc._tuple_desc_map[i])) return false;
}
return true;
}

bool RowDescriptor::layout_equals(const RowDescriptor& other_desc) const {
if (_tuple_desc_map.size() != other_desc._tuple_desc_map.size()) return false;
return layout_is_prefix_of(other_desc);
}

std::string RowDescriptor::debug_string() const {
std::stringstream ss;

Expand Down Expand Up @@ -674,15 +643,6 @@ SlotDescriptor* DescriptorTbl::get_slot_descriptor(SlotId id) const {
}
}

bool SlotDescriptor::layout_equals(const SlotDescriptor& other_desc) const {
if (type().type != other_desc.type().type) return false;
if (is_nullable() != other_desc.is_nullable()) return false;
if (slot_size() != other_desc.slot_size()) return false;
if (tuple_offset() != other_desc.tuple_offset()) return false;
if (!null_indicator_offset().equals(other_desc.null_indicator_offset())) return false;
return true;
}

std::string DescriptorTbl::debug_string() const {
std::stringstream out;
out << "tuples:\n";
Expand Down
Loading