Skip to content

Commit 13e0953

Browse files
Merge branch 'apache:master' into s4
2 parents 4ce1a9a + e0df398 commit 13e0953

File tree

3,817 files changed

+1734679
-10979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,817 files changed

+1734679
-10979
lines changed

be/src/clucene

be/src/common/cast_set.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@
2323

2424
#include "common/exception.h"
2525
#include "common/status.h"
26+
#include "vec/core/extended_types.h"
2627

2728
namespace doris {
2829

2930
template <typename T, typename U>
3031
void check_cast_value(U b) {
31-
if constexpr (std::is_unsigned_v<U>) {
32+
if constexpr (IsUnsignedV<U>) {
3233
if (b > std::numeric_limits<T>::max()) {
3334
throw doris::Exception(ErrorCode::INVALID_ARGUMENT,
3435
"value {} cast to type {} out of range [{},{}]", b,
3536
typeid(T).name(), std::numeric_limits<T>::min(),
3637
std::numeric_limits<T>::max());
3738
}
38-
} else if constexpr (std::is_unsigned_v<T>) {
39+
} else if constexpr (IsUnsignedV<T>) {
3940
if (b < 0 || b > std::numeric_limits<T>::max()) {
4041
throw doris::Exception(ErrorCode::INVALID_ARGUMENT,
4142
"value {} cast to type {} out of range [{},{}]", b,
@@ -53,7 +54,7 @@ void check_cast_value(U b) {
5354
}
5455

5556
template <typename T, typename U, bool need_check_value = true>
56-
requires std::is_integral_v<T> && std::is_integral_v<U>
57+
requires IsIntegralV<T> && IsIntegralV<U>
5758
void cast_set(T& a, U b) {
5859
if constexpr (need_check_value) {
5960
check_cast_value<T>(b);
@@ -68,7 +69,7 @@ void cast_set(T& a, U b) {
6869
}
6970

7071
template <typename T, typename U, bool need_check_value = true>
71-
requires std::is_integral_v<T> && std::is_integral_v<U>
72+
requires IsIntegralV<T> && IsIntegralV<U>
7273
T cast_set(U b) {
7374
if constexpr (need_check_value) {
7475
check_cast_value<T>(b);

be/src/common/config.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,12 +1047,11 @@ DEFINE_Int64(segcompaction_task_max_bytes, "157286400");
10471047
// Global segcompaction thread pool size.
10481048
DEFINE_mInt32(segcompaction_num_threads, "5");
10491049

1050+
DEFINE_mInt32(segcompaction_wait_for_dbm_task_timeout_s, "3600"); // 1h
1051+
10501052
// enable java udf and jdbc scannode
10511053
DEFINE_Bool(enable_java_support, "true");
10521054

1053-
// enable prefetch tablets before opening
1054-
DEFINE_mBool(enable_prefetch_tablet, "true");
1055-
10561055
// Set config randomly to check more issues in github workflow
10571056
DEFINE_Bool(enable_fuzzy_mode, "false");
10581057

be/src/common/config.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,15 +1087,14 @@ DECLARE_Int32(segcompaction_task_max_rows);
10871087
// Max total file size allowed in a single segcompaction task.
10881088
DECLARE_Int64(segcompaction_task_max_bytes);
10891089

1090+
DECLARE_Int32(segcompaction_wait_for_dbm_task_timeout_s);
1091+
10901092
// Global segcompaction thread pool size.
10911093
DECLARE_mInt32(segcompaction_num_threads);
10921094

10931095
// enable java udf and jdbc scannode
10941096
DECLARE_Bool(enable_java_support);
10951097

1096-
// enable prefetch tablets before opening
1097-
DECLARE_mBool(enable_prefetch_tablet);
1098-
10991098
// Set config randomly to check more issues in github workflow
11001099
DECLARE_Bool(enable_fuzzy_mode);
11011100

be/src/common/exception.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ Exception::Exception(int code, const std::string_view& msg) {
3434
_err_msg->_stack = get_stack_trace(0, "DISABLED");
3535
}
3636
// BE UT TEST exceptions thrown during execution cannot be caught
37-
// and the error `C++ exception with description "argument not found" thrown in the test body` will be printed.
38-
std::cout << "Exception: " << code << ", " << msg << ", " << get_stack_trace(0, "DISABLED")
39-
<< std::endl;
37+
// and the error `C++ exception with description "argument not found" thrown in the test body` will be printed,
38+
// which is of not much help.
39+
// Disabled by default because now there are a lot of UT case that throw exceptions
40+
// and it may slow down the test execution.
41+
// Open this code to print the stack trace if you need to debug the UT case.
42+
// std::cout << "Exception: " << code << ", " << msg << ", " << get_stack_trace(0, "DISABLED")
43+
// << std::endl;
4044
#endif
4145
if (config::exit_on_exception) {
4246
LOG(FATAL) << "[ExitOnException] error code: " << code << ", message: " << msg;

be/src/common/signal_handler.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,16 @@ inline void set_signal_task_id(TUniqueId tid) {
439439
query_id_lo = tid.lo;
440440
}
441441

442+
// this struct is used to set signal task id in the constructor and reset it in the destructor
443+
// thread pool will reuse pthread, so we need to clean thread local data
444+
struct SignalTaskIdKeeper {
445+
template <typename T>
446+
SignalTaskIdKeeper(const T& id) {
447+
set_signal_task_id(id);
448+
}
449+
~SignalTaskIdKeeper() { set_signal_task_id(PUniqueId {}); }
450+
};
451+
442452
inline void set_signal_is_nereids(bool is_nereids_arg) {
443453
is_nereids = is_nereids_arg;
444454
}

be/src/common/status.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ namespace ErrorCode {
135135
E(QUERY_MEMORY_EXCEEDED, -257, false); \
136136
E(WORKLOAD_GROUP_MEMORY_EXCEEDED, -258, false); \
137137
E(PROCESS_MEMORY_EXCEEDED, -259, false); \
138+
E(INVALID_INPUT_SYNTAX, -260, false); \
138139
E(CE_CMD_PARAMS_ERROR, -300, true); \
139140
E(CE_BUFFER_TOO_SMALL, -301, true); \
140141
E(CE_CMD_NOT_VALID, -302, true); \

be/src/gutil/endian.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include <assert.h>
3434

3535
#include "olap/uint24.h"
36-
#include "vec/core/wide_integer.h"
36+
#include "vec/core/extended_types.h"
3737

3838
inline uint16_t UNALIGNED_LOAD16(const void* p) {
3939
uint16_t t;

be/src/gutil/strings/numbers.cc

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,57 @@ int FloatToBuffer(float value, int width, char* buffer) {
139139
return snprintf_result;
140140
}
141141

142+
// refer to: https://en.cppreference.com/w/cpp/types/numeric_limits/max_digits10.html
142143
int FastDoubleToBuffer(double value, char* buffer) {
143-
auto end = fmt::format_to(buffer, FMT_COMPILE("{}"), value);
144+
char* end = nullptr;
145+
// output NaN and Infinity to be compatible with most of the implementations
146+
if (std::isnan(value)) {
147+
static constexpr char nan_str[] = "NaN";
148+
static constexpr int nan_str_len = sizeof(nan_str) - 1;
149+
memcpy(buffer, nan_str, nan_str_len);
150+
end = buffer + nan_str_len;
151+
} else if (std::isinf(value)) {
152+
static constexpr char inf_str[] = "Infinity";
153+
static constexpr int inf_str_len = sizeof(inf_str) - 1;
154+
static constexpr char neg_inf_str[] = "-Infinity";
155+
static constexpr int neg_inf_str_len = sizeof(neg_inf_str) - 1;
156+
if (value > 0) {
157+
memcpy(buffer, inf_str, inf_str_len);
158+
end = buffer + inf_str_len;
159+
} else {
160+
memcpy(buffer, neg_inf_str, neg_inf_str_len);
161+
end = buffer + neg_inf_str_len;
162+
}
163+
} else {
164+
end = fmt::format_to(buffer, FMT_COMPILE("{}"), value);
165+
}
144166
*end = '\0';
145167
return end - buffer;
146168
}
147169

148170
int FastFloatToBuffer(float value, char* buffer) {
149-
auto* end = fmt::format_to(buffer, FMT_COMPILE("{}"), value);
171+
char* end = nullptr;
172+
// output NaN and Infinity to be compatible with most of the implementations
173+
if (std::isnan(value)) {
174+
static constexpr char nan_str[] = "NaN";
175+
static constexpr int nan_str_len = sizeof(nan_str) - 1;
176+
memcpy(buffer, nan_str, nan_str_len);
177+
end = buffer + nan_str_len;
178+
} else if (std::isinf(value)) {
179+
static constexpr char inf_str[] = "Infinity";
180+
static constexpr int inf_str_len = sizeof(inf_str) - 1;
181+
static constexpr char neg_inf_str[] = "-Infinity";
182+
static constexpr int neg_inf_str_len = sizeof(neg_inf_str) - 1;
183+
if (value > 0) {
184+
memcpy(buffer, inf_str, inf_str_len);
185+
end = buffer + inf_str_len;
186+
} else {
187+
memcpy(buffer, neg_inf_str, neg_inf_str_len);
188+
end = buffer + neg_inf_str_len;
189+
}
190+
} else {
191+
end = fmt::format_to(buffer, FMT_COMPILE("{}"), value);
192+
}
150193
*end = '\0';
151194
return end - buffer;
152195
}

be/src/io/cache/lru_queue_recorder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ void LRUQueueRecorder::replay_queue_event(FileCacheType type) {
5454
break;
5555
}
5656
case CacheLRULogType::MOVETOBACK: {
57-
LOG(INFO) << "MOVETOBACK" << log->hash.to_string() << " " << log->offset;
5857
auto it = shadow_queue.get(log->hash, log->offset, lru_log_lock);
5958
if (it != std::list<LRUQueue::FileKeyAndOffset>::iterator()) {
6059
shadow_queue.move_to_end(it, lru_log_lock);

0 commit comments

Comments
 (0)