This is an automated email from the ASF dual-hosted git repository.
panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 754e7e2d27a [Chore](compile) add some compile_check_begin (#55523)
754e7e2d27a is described below
commit 754e7e2d27ae00ba195aa0177962fa16d8c6d4a8
Author: Pxl <[email protected]>
AuthorDate: Tue Sep 2 14:47:15 2025 +0800
[Chore](compile) add some compile_check_begin (#55523)
add some compile_check_begin
---
be/src/pipeline/exec/set_sink_operator.cpp | 2 +-
be/src/util/coding.cpp | 33 +++++++++++-----------
be/src/util/coding.h | 12 ++++----
be/src/util/hash/city.cc | 6 ++--
be/src/vec/common/endian.h | 6 ++--
.../vec/common/hash_table/hash_table_set_build.h | 8 ++++--
.../vec/common/hash_table/hash_table_set_probe.h | 9 +++---
be/src/vec/common/sip_hash.h | 6 ++--
.../vec/functions/complex_hash_map_dictionary.cpp | 8 +++---
9 files changed, 46 insertions(+), 44 deletions(-)
diff --git a/be/src/pipeline/exec/set_sink_operator.cpp
b/be/src/pipeline/exec/set_sink_operator.cpp
index 7616cb85c82..f557ca57d65 100644
--- a/be/src/pipeline/exec/set_sink_operator.cpp
+++ b/be/src/pipeline/exec/set_sink_operator.cpp
@@ -123,7 +123,7 @@ Status SetSinkOperatorX<is_intersect>::_process_build_block(
using HashTableCtxType = std::decay_t<decltype(arg)>;
if constexpr (!std::is_same_v<HashTableCtxType,
std::monostate>) {
vectorized::HashTableBuild<HashTableCtxType, is_intersect>
- hash_table_build_process(&local_state, rows,
raw_ptrs, state);
+ hash_table_build_process(&local_state,
uint32_t(rows), raw_ptrs, state);
st = hash_table_build_process(arg, local_state._arena);
} else {
LOG(FATAL) << "FATAL: uninited hash table";
diff --git a/be/src/util/coding.cpp b/be/src/util/coding.cpp
index e30df6a4eb0..75c29193382 100644
--- a/be/src/util/coding.cpp
+++ b/be/src/util/coding.cpp
@@ -9,30 +9,31 @@
#include "util/coding.h"
namespace doris {
+#include "common/compile_check_begin.h"
uint8_t* encode_varint32(uint8_t* dst, uint32_t v) {
// Operate on characters as unsigneds
static const int B = 128;
if (v < (1 << 7)) {
- *(dst++) = v;
+ *(dst++) = uint8_t(v);
} else if (v < (1 << 14)) {
- *(dst++) = v | B;
- *(dst++) = v >> 7;
+ *(dst++) = uint8_t(v | B);
+ *(dst++) = uint8_t(v >> 7);
} else if (v < (1 << 21)) {
- *(dst++) = v | B;
- *(dst++) = (v >> 7) | B;
- *(dst++) = v >> 14;
+ *(dst++) = uint8_t(v | B);
+ *(dst++) = uint8_t((v >> 7) | B);
+ *(dst++) = uint8_t(v >> 14);
} else if (v < (1 << 28)) {
- *(dst++) = v | B;
- *(dst++) = (v >> 7) | B;
- *(dst++) = (v >> 14) | B;
- *(dst++) = v >> 21;
+ *(dst++) = uint8_t(v | B);
+ *(dst++) = uint8_t((v >> 7) | B);
+ *(dst++) = uint8_t((v >> 14) | B);
+ *(dst++) = uint8_t(v >> 21);
} else {
- *(dst++) = v | B;
- *(dst++) = (v >> 7) | B;
- *(dst++) = (v >> 14) | B;
- *(dst++) = (v >> 21) | B;
- *(dst++) = v >> 28;
+ *(dst++) = uint8_t(v | B);
+ *(dst++) = uint8_t((v >> 7) | B);
+ *(dst++) = uint8_t((v >> 14) | B);
+ *(dst++) = uint8_t((v >> 21) | B);
+ *(dst++) = uint8_t(v >> 28);
}
return dst;
}
@@ -71,5 +72,5 @@ const uint8_t* decode_varint64_ptr(const uint8_t* p, const
uint8_t* limit, uint6
}
return nullptr;
}
-
+#include "common/compile_check_end.h"
} // namespace doris
diff --git a/be/src/util/coding.h b/be/src/util/coding.h
index 8851f1af86c..c2d669d6754 100644
--- a/be/src/util/coding.h
+++ b/be/src/util/coding.h
@@ -21,7 +21,7 @@
#include "vec/common/endian.h"
namespace doris {
-
+#include "common/compile_check_begin.h"
// TODO(zc): add encode big endian later when we need it
// use big endian when we have order requirement.
// little endian is more efficient when we use X86 CPU, so
@@ -118,7 +118,7 @@ inline uint8_t* encode_varint64(uint8_t* dst, uint64_t v) {
// Fetch low seven bits from current v, and the eight bit is marked as
compression mark.
// v | B is optimised from (v & (B-1)) | B, because result is assigned
to uint8_t and other bits
// is cleared by implicit conversion.
- *(dst++) = v | B;
+ *(dst++) = uint8_t(v | B);
v >>= 7;
}
*(dst++) = static_cast<unsigned char>(v);
@@ -158,7 +158,7 @@ void put_varint64(T* dst, uint64_t v) {
template <typename T>
void put_length_prefixed_slice(T* dst, const Slice& value) {
- put_varint32(dst, value.get_size());
+ put_varint32(dst, uint32_t(value.get_size()));
dst->append(value.get_data(), value.get_size());
}
@@ -174,7 +174,7 @@ void put_varint64_varint32(T* dst, uint64_t v1, uint32_t
v2) {
// on success, return true and advance `input` past the parsed value.
// on failure, return false and `input` is not modified.
inline bool get_varint32(Slice* input, uint32_t* val) {
- const uint8_t* p = (const uint8_t*)input->data;
+ const auto* p = (const uint8_t*)input->data;
const uint8_t* limit = p + input->size;
const uint8_t* q = decode_varint32_ptr(p, limit, val);
if (q == nullptr) {
@@ -189,7 +189,7 @@ inline bool get_varint32(Slice* input, uint32_t* val) {
// on success, return true and advance `input` past the parsed value.
// on failure, return false and `input` is not modified.
inline bool get_varint64(Slice* input, uint64_t* val) {
- const uint8_t* p = (const uint8_t*)input->data;
+ const auto* p = (const uint8_t*)input->data;
const uint8_t* limit = p + input->size;
const uint8_t* q = decode_varint64_ptr(p, limit, val);
if (q == nullptr) {
@@ -213,5 +213,5 @@ inline bool get_length_prefixed_slice(Slice* input, Slice*
val) {
return false;
}
}
-
+#include "common/compile_check_end.h"
} // namespace doris
diff --git a/be/src/util/hash/city.cc b/be/src/util/hash/city.cc
index bad4a7585d9..bac567d35af 100644
--- a/be/src/util/hash/city.cc
+++ b/be/src/util/hash/city.cc
@@ -40,7 +40,7 @@
#include "vec/common/endian.h"
namespace doris::util_hash {
-
+#include "common/compile_check_begin.h"
// Some primes between 2^63 and 2^64 for various uses.
static const uint64_t k0 = 0xa5b85c5e198ed849ULL;
static const uint64_t k1 = 0x8d58ac26afe12e47ULL;
@@ -85,7 +85,7 @@ static uint64_t HashLen0to16(const char* s, size_t len) {
if (len > 8) {
uint64_t a = LittleEndian::Load64(s);
uint64_t b = LittleEndian::Load64(s + len - 8);
- return HashLen16(a, RotateByAtLeast1(b + len, len)) ^ b;
+ return HashLen16(a, RotateByAtLeast1(b + len, int(len))) ^ b;
}
if (len >= 4) {
uint64_t a = LittleEndian::Load32(s);
@@ -96,7 +96,7 @@ static uint64_t HashLen0to16(const char* s, size_t len) {
uint8_t b = s[len >> 1];
uint8_t c = s[len - 1];
uint32_t y = static_cast<uint32_t>(a) + (static_cast<uint32_t>(b) <<
8);
- uint32_t z = len + (static_cast<uint32_t>(c) << 2);
+ uint32_t z = static_cast<uint32_t>(len) + (static_cast<uint32_t>(c) <<
2);
return ShiftMix(y * k2 ^ z * k3) * k2;
}
return k2;
diff --git a/be/src/vec/common/endian.h b/be/src/vec/common/endian.h
index b10a6f65c13..48b1ad771c3 100644
--- a/be/src/vec/common/endian.h
+++ b/be/src/vec/common/endian.h
@@ -22,7 +22,7 @@
#include "vec/core/extended_types.h"
namespace doris {
-
+#include "common/compile_check_begin.h"
inline uint64_t gbswap_64(uint64_t host_int) {
#if defined(__GNUC__) && defined(__x86_64__) && !defined(__APPLE__)
// Adapted from /usr/include/byteswap.h. Not available on Mac.
@@ -54,7 +54,7 @@ inline wide::UInt256 gbswap_256(wide::UInt256 host_int) {
// Swap bytes of a 24-bit value.
inline uint32_t bswap_24(uint32_t x) {
- return ((x & 0x0000ffULL) << 16) | ((x & 0x00ff00ULL)) | ((x &
0xff0000ULL) >> 16);
+ return uint32_t((x & 0x0000ffULL) << 16) | ((x & 0x00ff00ULL)) | ((x &
0xff0000ULL) >> 16);
}
// use std::byteswap after doris enable cpp23
@@ -153,5 +153,5 @@ public:
unaligned_store<uint64_t>(p, to_endian<std::endian::big>(v));
}
}; // BigEndian
-
+#include "common/compile_check_end.h"
} // namespace doris
\ No newline at end of file
diff --git a/be/src/vec/common/hash_table/hash_table_set_build.h
b/be/src/vec/common/hash_table/hash_table_set_build.h
index b90cafc0883..bd66b9d3197 100644
--- a/be/src/vec/common/hash_table/hash_table_set_build.h
+++ b/be/src/vec/common/hash_table/hash_table_set_build.h
@@ -20,11 +20,13 @@
#include "vec/columns/column.h"
namespace doris::vectorized {
+#include "common/compile_check_begin.h"
constexpr size_t CHECK_FRECUENCY = 65536;
template <class HashTableContext, bool is_intersect>
struct HashTableBuild {
template <typename Parent>
- HashTableBuild(Parent* parent, size_t rows, ColumnRawPtrs& build_raw_ptrs,
RuntimeState* state)
+ HashTableBuild(Parent* parent, uint32_t rows, ColumnRawPtrs&
build_raw_ptrs,
+ RuntimeState* state)
: _rows(rows), _build_raw_ptrs(build_raw_ptrs), _state(state) {}
Status operator()(HashTableContext& hash_table_ctx, Arena& arena) {
@@ -50,9 +52,9 @@ struct HashTableBuild {
}
private:
- const size_t _rows;
+ const uint32_t _rows;
ColumnRawPtrs& _build_raw_ptrs;
RuntimeState* _state = nullptr;
};
-
+#include "common/compile_check_end.h"
} // namespace doris::vectorized
diff --git a/be/src/vec/common/hash_table/hash_table_set_probe.h
b/be/src/vec/common/hash_table/hash_table_set_probe.h
index 943aa5cfe37..fbb2d3d1fde 100644
--- a/be/src/vec/common/hash_table/hash_table_set_probe.h
+++ b/be/src/vec/common/hash_table/hash_table_set_probe.h
@@ -16,15 +16,14 @@
// under the License.
#include "pipeline/exec/set_probe_sink_operator.h"
-#include "runtime/runtime_state.h"
#include "vec/columns/column.h"
namespace doris::vectorized {
-
+#include "common/compile_check_begin.h"
template <class HashTableContext, bool is_intersected>
struct HashTableProbe {
template <typename Parent>
- HashTableProbe(Parent* parent, int probe_rows)
+ HashTableProbe(Parent* parent, uint32_t probe_rows)
: _valid_element_in_hash_tbl(parent->valid_element_in_hash_tbl()),
_probe_rows(probe_rows),
_probe_raw_ptrs(parent->_probe_columns) {}
@@ -54,9 +53,9 @@ struct HashTableProbe {
private:
int64_t* _valid_element_in_hash_tbl = nullptr;
- const size_t _probe_rows;
+ const uint32_t _probe_rows;
ColumnRawPtrs& _probe_raw_ptrs;
std::vector<StringRef> _probe_keys;
};
-
+#include "common/compile_check_end.h"
} // namespace doris::vectorized
diff --git a/be/src/vec/common/sip_hash.h b/be/src/vec/common/sip_hash.h
index 8568d5bb7d0..0f9c23d698d 100644
--- a/be/src/vec/common/sip_hash.h
+++ b/be/src/vec/common/sip_hash.h
@@ -41,7 +41,7 @@
#include "vec/core/types.h"
namespace doris {
-
+#include "common/compile_check_begin.h"
#define ROTL(x, b) static_cast<vectorized::UInt64>(((x) << (b)) | ((x) >> (64
- (b))))
#define SIPROUND \
@@ -81,7 +81,7 @@ private:
ALWAYS_INLINE void finalize() {
/// In the last free byte, we write the remainder of the division by
256.
- current_bytes[7] = cnt;
+ current_bytes[7] = uint8_t(cnt);
v3 ^= current_word;
SIPROUND;
@@ -217,5 +217,5 @@ inline void sip_hash128(const char* data, const size_t
size, char* out) {
hash.update(data, size);
hash.get128(out);
}
-
+#include "common/compile_check_end.h"
} // namespace doris
\ No newline at end of file
diff --git a/be/src/vec/functions/complex_hash_map_dictionary.cpp
b/be/src/vec/functions/complex_hash_map_dictionary.cpp
index b0a75bb2cff..cb1625b9323 100644
--- a/be/src/vec/functions/complex_hash_map_dictionary.cpp
+++ b/be/src/vec/functions/complex_hash_map_dictionary.cpp
@@ -26,7 +26,7 @@
#include "vec/functions/dictionary.h"
namespace doris::vectorized {
-
+#include "common/compile_check_begin.h"
ComplexHashMapDictionary::~ComplexHashMapDictionary() {
if (_mem_tracker) {
SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_mem_tracker);
@@ -70,7 +70,7 @@ void ComplexHashMapDictionary::load_data(const ColumnPtrs&
key_columns, const Da
}
State state(key_raw_columns);
- const size_t rows = key_columns[0]->size();
+ auto rows = uint32_t(key_columns[0]->size());
dict_method.init_serialized_keys(key_raw_columns,
rows);
size_t input_rows = 0;
for (int i = 0; i < rows; i++) {
@@ -131,7 +131,7 @@ ColumnPtrs ComplexHashMapDictionary::get_tuple_columns(
"not nullable type");
}
- const size_t rows = key_columns[0]->size();
+ auto rows = uint32_t(key_columns[0]->size());
IColumn::Selector value_index = IColumn::Selector(rows);
// if key is not found, or key is null , wiil set true
NullMap key_not_found = NullMap(rows, false);
@@ -229,5 +229,5 @@ ColumnPtr ComplexHashMapDictionary::get_single_value_column(
return ColumnNullable::create(std::move(res_column), std::move(res_null));
}
-
+#include "common/compile_check_end.h"
} // namespace doris::vectorized
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]