Skip to content

Commit 4abb401

Browse files
authored
fix compilation error on arm64 (#9839)
close #9838 Signed-off-by: guo-shaoge <[email protected]>
1 parent 57122fa commit 4abb401

File tree

2 files changed

+128
-77
lines changed

2 files changed

+128
-77
lines changed

dbms/src/Columns/ColumnDecimal.cpp

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,122 @@ const char * ColumnDecimal<T>::deserializeAndInsertFromArena(const char * pos, c
139139
}
140140
}
141141

142+
template <typename T>
143+
void ColumnDecimal<T>::countSerializeByteSizeForCmp(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr &)
144+
const
145+
{
146+
countSerializeByteSizeImpl<true>(byte_size);
147+
}
148+
149+
template <typename T>
150+
void ColumnDecimal<T>::countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const
151+
{
152+
countSerializeByteSizeImpl<false>(byte_size);
153+
}
154+
155+
156+
template <typename T>
157+
void ColumnDecimal<T>::countSerializeByteSizeForCmpColumnArray(
158+
PaddedPODArray<size_t> & byte_size,
159+
const IColumn::Offsets & array_offsets,
160+
const TiDB::TiDBCollatorPtr &) const
161+
{
162+
countSerializeByteSizeForColumnArrayImpl<true>(byte_size, array_offsets);
163+
}
164+
165+
template <typename T>
166+
void ColumnDecimal<T>::countSerializeByteSizeForColumnArray(
167+
PaddedPODArray<size_t> & byte_size,
168+
const IColumn::Offsets & array_offsets) const
169+
{
170+
countSerializeByteSizeForColumnArrayImpl<false>(byte_size, array_offsets);
171+
}
172+
173+
174+
template <typename T>
175+
void ColumnDecimal<T>::serializeToPosForCmp(
176+
PaddedPODArray<char *> & pos,
177+
size_t start,
178+
size_t length,
179+
bool has_null,
180+
const TiDB::TiDBCollatorPtr &,
181+
String *) const
182+
{
183+
if (has_null)
184+
serializeToPosImpl</*has_null=*/true, /*for_compare=*/true>(pos, start, length);
185+
else
186+
serializeToPosImpl</*has_null=*/false, /*for_compare=*/true>(pos, start, length);
187+
}
188+
189+
template <typename T>
190+
void ColumnDecimal<T>::serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const
191+
{
192+
if (has_null)
193+
serializeToPosImpl</*has_null=*/true, /*for_compare=*/false>(pos, start, length);
194+
else
195+
serializeToPosImpl</*has_null=*/false, /*for_compare=*/false>(pos, start, length);
196+
}
197+
198+
template <typename T>
199+
void ColumnDecimal<T>::serializeToPosForCmpColumnArray(
200+
PaddedPODArray<char *> & pos,
201+
size_t start,
202+
size_t length,
203+
bool has_null,
204+
const IColumn::Offsets & array_offsets,
205+
const TiDB::TiDBCollatorPtr &,
206+
String *) const
207+
{
208+
if (has_null)
209+
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/true>(pos, start, length, array_offsets);
210+
else
211+
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/true>(pos, start, length, array_offsets);
212+
}
213+
214+
template <typename T>
215+
void ColumnDecimal<T>::serializeToPosForColumnArray(
216+
PaddedPODArray<char *> & pos,
217+
size_t start,
218+
size_t length,
219+
bool has_null,
220+
const IColumn::Offsets & array_offsets) const
221+
{
222+
if (has_null)
223+
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/false>(pos, start, length, array_offsets);
224+
else
225+
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/false>(pos, start, length, array_offsets);
226+
}
227+
228+
template <typename T>
229+
void ColumnDecimal<T>::deserializeForCmpAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer)
230+
{
231+
deserializeAndInsertFromPosImpl<true>(pos, use_nt_align_buffer);
232+
}
233+
234+
template <typename T>
235+
void ColumnDecimal<T>::deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer)
236+
{
237+
deserializeAndInsertFromPosImpl<false>(pos, use_nt_align_buffer);
238+
}
239+
240+
template <typename T>
241+
void ColumnDecimal<T>::deserializeForCmpAndInsertFromPosColumnArray(
242+
PaddedPODArray<char *> & pos,
243+
const IColumn::Offsets & array_offsets,
244+
bool use_nt_align_buffer)
245+
{
246+
deserializeAndInsertFromPosForColumnArrayImpl<true>(pos, array_offsets, use_nt_align_buffer);
247+
}
248+
249+
template <typename T>
250+
void ColumnDecimal<T>::deserializeAndInsertFromPosForColumnArray(
251+
PaddedPODArray<char *> & pos,
252+
const IColumn::Offsets & array_offsets,
253+
bool use_nt_align_buffer)
254+
{
255+
deserializeAndInsertFromPosForColumnArrayImpl<false>(pos, array_offsets, use_nt_align_buffer);
256+
}
257+
142258
template <typename T>
143259
template <bool for_compare>
144260
void ColumnDecimal<T>::countSerializeByteSizeImpl(PaddedPODArray<size_t> & byte_size) const
@@ -160,7 +276,6 @@ void ColumnDecimal<T>::countSerializeByteSizeImpl(PaddedPODArray<size_t> & byte_
160276
}
161277
}
162278

163-
// TODO add unit test
164279
template <typename T>
165280
template <bool for_compare>
166281
void ColumnDecimal<T>::countSerializeByteSizeForColumnArrayImpl(

dbms/src/Columns/ColumnDecimal.h

Lines changed: 12 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -173,49 +173,25 @@ class ColumnDecimal final : public COWPtrHelper<ColumnVectorHelper, ColumnDecima
173173
String &) const override;
174174
const char * deserializeAndInsertFromArena(const char * pos, const TiDB::TiDBCollatorPtr &) override;
175175

176-
void countSerializeByteSizeForCmp(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr &) const override
177-
{
178-
countSerializeByteSizeImpl<true>(byte_size);
179-
}
180-
void countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const override
181-
{
182-
countSerializeByteSizeImpl<false>(byte_size);
183-
}
176+
void countSerializeByteSizeForCmp(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr &) const override;
177+
void countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const override;
184178

185179
void countSerializeByteSizeForCmpColumnArray(
186180
PaddedPODArray<size_t> & byte_size,
187181
const IColumn::Offsets & array_offsets,
188-
const TiDB::TiDBCollatorPtr &) const override
189-
{
190-
countSerializeByteSizeForColumnArrayImpl<true>(byte_size, array_offsets);
191-
}
182+
const TiDB::TiDBCollatorPtr &) const override;
192183
void countSerializeByteSizeForColumnArray(
193184
PaddedPODArray<size_t> & byte_size,
194-
const IColumn::Offsets & array_offsets) const override
195-
{
196-
countSerializeByteSizeForColumnArrayImpl<false>(byte_size, array_offsets);
197-
}
185+
const IColumn::Offsets & array_offsets) const override;
198186

199187
void serializeToPosForCmp(
200188
PaddedPODArray<char *> & pos,
201189
size_t start,
202190
size_t length,
203191
bool has_null,
204192
const TiDB::TiDBCollatorPtr &,
205-
String *) const override
206-
{
207-
if (has_null)
208-
serializeToPosImpl</*has_null=*/true, /*for_compare=*/true>(pos, start, length);
209-
else
210-
serializeToPosImpl</*has_null=*/false, /*for_compare=*/true>(pos, start, length);
211-
}
212-
void serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const override
213-
{
214-
if (has_null)
215-
serializeToPosImpl</*has_null=*/true, /*for_compare=*/false>(pos, start, length);
216-
else
217-
serializeToPosImpl</*has_null=*/false, /*for_compare=*/false>(pos, start, length);
218-
}
193+
String *) const override;
194+
void serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const override;
219195

220196
void serializeToPosForCmpColumnArray(
221197
PaddedPODArray<char *> & pos,
@@ -224,65 +200,25 @@ class ColumnDecimal final : public COWPtrHelper<ColumnVectorHelper, ColumnDecima
224200
bool has_null,
225201
const IColumn::Offsets & array_offsets,
226202
const TiDB::TiDBCollatorPtr &,
227-
String *) const override
228-
{
229-
if (has_null)
230-
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/true>(
231-
pos,
232-
start,
233-
length,
234-
array_offsets);
235-
else
236-
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/true>(
237-
pos,
238-
start,
239-
length,
240-
array_offsets);
241-
}
203+
String *) const override;
242204
void serializeToPosForColumnArray(
243205
PaddedPODArray<char *> & pos,
244206
size_t start,
245207
size_t length,
246208
bool has_null,
247-
const IColumn::Offsets & array_offsets) const override
248-
{
249-
if (has_null)
250-
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/false>(
251-
pos,
252-
start,
253-
length,
254-
array_offsets);
255-
else
256-
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/false>(
257-
pos,
258-
start,
259-
length,
260-
array_offsets);
261-
}
209+
const IColumn::Offsets & array_offsets) const override;
262210

263-
void deserializeForCmpAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override
264-
{
265-
deserializeAndInsertFromPosImpl<true>(pos, use_nt_align_buffer);
266-
}
267-
void deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override
268-
{
269-
deserializeAndInsertFromPosImpl<false>(pos, use_nt_align_buffer);
270-
}
211+
void deserializeForCmpAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override;
212+
void deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override;
271213

272214
void deserializeForCmpAndInsertFromPosColumnArray(
273215
PaddedPODArray<char *> & pos,
274216
const IColumn::Offsets & array_offsets,
275-
bool use_nt_align_buffer) override
276-
{
277-
deserializeAndInsertFromPosForColumnArrayImpl<true>(pos, array_offsets, use_nt_align_buffer);
278-
}
217+
bool use_nt_align_buffer) override;
279218
void deserializeAndInsertFromPosForColumnArray(
280219
PaddedPODArray<char *> & pos,
281220
const IColumn::Offsets & array_offsets,
282-
bool use_nt_align_buffer) override
283-
{
284-
deserializeAndInsertFromPosForColumnArrayImpl<false>(pos, array_offsets, use_nt_align_buffer);
285-
}
221+
bool use_nt_align_buffer) override;
286222

287223
void flushNTAlignBuffer() override;
288224

0 commit comments

Comments
 (0)