Skip to content

Commit aef4694

Browse files
authored
[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 <!-- At least one of them must be included. --> - [ ] 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 <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
1 parent a771037 commit aef4694

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

be/src/core/data_type_serde/data_type_number_serde.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "core/data_type/define_primitive_type.h"
2828
#include "core/data_type/primitive_type.h"
2929
#include "core/data_type_serde/data_type_serde.h"
30+
#include "core/packed_int128.h"
3031
#include "core/types.h"
3132
#include "core/value/timestamptz_value.h"
3233
#include "exprs/function/cast/cast_to_basic_number_common.h"

be/src/core/data_type_serde/data_type_serde.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,6 @@ struct FieldInfo {
111111
int scale = 0;
112112
int precision = 0;
113113
};
114-
struct PackedUInt128 {
115-
// PackedInt128() : value(0) {}
116-
PackedUInt128() = default;
117-
118-
PackedUInt128(const unsigned __int128& value_) { value = value_; }
119-
PackedUInt128& operator=(const unsigned __int128& value_) {
120-
value = value_;
121-
return *this;
122-
}
123-
PackedUInt128& operator=(const PackedUInt128& rhs) = default;
124-
125-
uint128_t value;
126-
} __attribute__((packed));
127114

128115
// Deserialize means read from different file format or memory format,
129116
// for example read from arrow, read from parquet.

be/src/core/packed_int128.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ struct PackedInt128 {
3737
__int128 value;
3838
} __attribute__((packed));
3939

40+
struct PackedUInt128 {
41+
PackedUInt128() = default;
42+
43+
PackedUInt128(const unsigned __int128& value_) { value = value_; }
44+
PackedUInt128& operator=(const unsigned __int128& value_) {
45+
value = value_;
46+
return *this;
47+
}
48+
PackedUInt128& operator=(const PackedUInt128& rhs) = default;
49+
50+
uint128_t value;
51+
} __attribute__((packed));
52+
4053
// unalign address directly casted to int128 will core dump
4154
inline int128_t get_int128_from_unalign(const void* address) {
4255
int128_t value = 0;

0 commit comments

Comments
 (0)