From 84d11afd3af81ae0c07bf1b750e0142341e0425f Mon Sep 17 00:00:00 2001 From: Chenyang Sun Date: Fri, 13 Mar 2026 14:11:56 +0800 Subject: [PATCH] [refactor](be) Move PackedUInt128 to packed_int128.h (#61250) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [x] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason - Behavior changed: - [ ] No. - [ ] Yes. - Does this need documentation? - [ ] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label --- .../core/data_type_serde/data_type_number_serde.cpp | 1 + be/src/core/data_type_serde/data_type_serde.h | 13 ------------- be/src/core/packed_int128.h | 13 +++++++++++++ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/be/src/core/data_type_serde/data_type_number_serde.cpp b/be/src/core/data_type_serde/data_type_number_serde.cpp index 2835e9002a6891..ad73ee3a988aa0 100644 --- a/be/src/core/data_type_serde/data_type_number_serde.cpp +++ b/be/src/core/data_type_serde/data_type_number_serde.cpp @@ -27,6 +27,7 @@ #include "core/data_type/define_primitive_type.h" #include "core/data_type/primitive_type.h" #include "core/data_type_serde/data_type_serde.h" +#include "core/packed_int128.h" #include "core/types.h" #include "core/value/timestamptz_value.h" #include "exprs/function/cast/cast_to_basic_number_common.h" diff --git a/be/src/core/data_type_serde/data_type_serde.h b/be/src/core/data_type_serde/data_type_serde.h index 4ffac54b89922f..b9a5cbe76bd9ea 100644 --- a/be/src/core/data_type_serde/data_type_serde.h +++ b/be/src/core/data_type_serde/data_type_serde.h @@ -111,19 +111,6 @@ struct FieldInfo { int scale = 0; int precision = 0; }; -struct PackedUInt128 { - // PackedInt128() : value(0) {} - PackedUInt128() = default; - - PackedUInt128(const unsigned __int128& value_) { value = value_; } - PackedUInt128& operator=(const unsigned __int128& value_) { - value = value_; - return *this; - } - PackedUInt128& operator=(const PackedUInt128& rhs) = default; - - uint128_t value; -} __attribute__((packed)); // Deserialize means read from different file format or memory format, // for example read from arrow, read from parquet. diff --git a/be/src/core/packed_int128.h b/be/src/core/packed_int128.h index 07d595fdd03681..ef59a8e752973d 100644 --- a/be/src/core/packed_int128.h +++ b/be/src/core/packed_int128.h @@ -37,6 +37,19 @@ struct PackedInt128 { __int128 value; } __attribute__((packed)); +struct PackedUInt128 { + PackedUInt128() = default; + + PackedUInt128(const unsigned __int128& value_) { value = value_; } + PackedUInt128& operator=(const unsigned __int128& value_) { + value = value_; + return *this; + } + PackedUInt128& operator=(const PackedUInt128& rhs) = default; + + uint128_t value; +} __attribute__((packed)); + // unalign address directly casted to int128 will core dump inline int128_t get_int128_from_unalign(const void* address) { int128_t value = 0;