From 2631c8015d35cfacbe712a961d039b5812cdcf38 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Tue, 28 Jan 2025 15:42:48 +0800 Subject: [PATCH] fix compilation error on arm64 Signed-off-by: guo-shaoge --- dbms/src/Columns/ColumnDecimal.cpp | 132 ++++++++++++++++++++++++++++- dbms/src/Columns/ColumnDecimal.h | 88 +++---------------- 2 files changed, 143 insertions(+), 77 deletions(-) diff --git a/dbms/src/Columns/ColumnDecimal.cpp b/dbms/src/Columns/ColumnDecimal.cpp index 36a774975ca..17cc8908650 100644 --- a/dbms/src/Columns/ColumnDecimal.cpp +++ b/dbms/src/Columns/ColumnDecimal.cpp @@ -139,6 +139,137 @@ const char * ColumnDecimal::deserializeAndInsertFromArena(const char * pos, c } } +template +void ColumnDecimal::countSerializeByteSizeForCmp(PaddedPODArray & byte_size, const TiDB::TiDBCollatorPtr &) const +{ + countSerializeByteSizeImpl(byte_size); +} + +template +void ColumnDecimal::countSerializeByteSize(PaddedPODArray & byte_size) const +{ + countSerializeByteSizeImpl(byte_size); +} + + +template +void ColumnDecimal::countSerializeByteSizeForCmpColumnArray( + PaddedPODArray & byte_size, + const IColumn::Offsets & array_offsets, + const TiDB::TiDBCollatorPtr &) const +{ + countSerializeByteSizeForColumnArrayImpl(byte_size, array_offsets); +} + +template +void ColumnDecimal::countSerializeByteSizeForColumnArray( + PaddedPODArray & byte_size, + const IColumn::Offsets & array_offsets) const +{ + countSerializeByteSizeForColumnArrayImpl(byte_size, array_offsets); +} + + +template +void ColumnDecimal::serializeToPosForCmp( + PaddedPODArray & pos, + size_t start, + size_t length, + bool has_null, + const TiDB::TiDBCollatorPtr &, + String *) const +{ + if (has_null) + serializeToPosImpl(pos, start, length); + else + serializeToPosImpl(pos, start, length); +} + +template +void ColumnDecimal::serializeToPos(PaddedPODArray & pos, size_t start, size_t length, bool has_null) const +{ + if (has_null) + serializeToPosImpl(pos, start, length); + else + serializeToPosImpl(pos, start, length); +} + +template +void ColumnDecimal::serializeToPosForCmpColumnArray( + PaddedPODArray & pos, + size_t start, + size_t length, + bool has_null, + const IColumn::Offsets & array_offsets, + const TiDB::TiDBCollatorPtr &, + String *) const +{ + if (has_null) + serializeToPosForColumnArrayImpl( + pos, + start, + length, + array_offsets); + else + serializeToPosForColumnArrayImpl( + pos, + start, + length, + array_offsets); +} + +template +void ColumnDecimal::serializeToPosForColumnArray( + PaddedPODArray & pos, + size_t start, + size_t length, + bool has_null, + const IColumn::Offsets & array_offsets) const +{ + if (has_null) + serializeToPosForColumnArrayImpl( + pos, + start, + length, + array_offsets); + else + serializeToPosForColumnArrayImpl( + pos, + start, + length, + array_offsets); +} + +template +void ColumnDecimal::deserializeForCmpAndInsertFromPos(PaddedPODArray & pos, bool use_nt_align_buffer) +{ + deserializeAndInsertFromPosImpl(pos, use_nt_align_buffer); +} + +template +void ColumnDecimal::deserializeAndInsertFromPos(PaddedPODArray & pos, bool use_nt_align_buffer) +{ + deserializeAndInsertFromPosImpl(pos, use_nt_align_buffer); +} + +template +void ColumnDecimal::deserializeForCmpAndInsertFromPosColumnArray( + PaddedPODArray & pos, + const IColumn::Offsets & array_offsets, + bool use_nt_align_buffer) +{ + deserializeAndInsertFromPosForColumnArrayImpl(pos, array_offsets, use_nt_align_buffer); +} + +template +void ColumnDecimal::deserializeAndInsertFromPosForColumnArray( + PaddedPODArray & pos, + const IColumn::Offsets & array_offsets, + bool use_nt_align_buffer) +{ + deserializeAndInsertFromPosForColumnArrayImpl(pos, array_offsets, use_nt_align_buffer); +} + template template void ColumnDecimal::countSerializeByteSizeImpl(PaddedPODArray & byte_size) const @@ -160,7 +291,6 @@ void ColumnDecimal::countSerializeByteSizeImpl(PaddedPODArray & byte_ } } -// TODO add unit test template template void ColumnDecimal::countSerializeByteSizeForColumnArrayImpl( diff --git a/dbms/src/Columns/ColumnDecimal.h b/dbms/src/Columns/ColumnDecimal.h index 18211b13177..d44eb992107 100644 --- a/dbms/src/Columns/ColumnDecimal.h +++ b/dbms/src/Columns/ColumnDecimal.h @@ -173,28 +173,16 @@ class ColumnDecimal final : public COWPtrHelper & byte_size, const TiDB::TiDBCollatorPtr &) const override - { - countSerializeByteSizeImpl(byte_size); - } - void countSerializeByteSize(PaddedPODArray & byte_size) const override - { - countSerializeByteSizeImpl(byte_size); - } + void countSerializeByteSizeForCmp(PaddedPODArray & byte_size, const TiDB::TiDBCollatorPtr &) const override; + void countSerializeByteSize(PaddedPODArray & byte_size) const override; void countSerializeByteSizeForCmpColumnArray( PaddedPODArray & byte_size, const IColumn::Offsets & array_offsets, - const TiDB::TiDBCollatorPtr &) const override - { - countSerializeByteSizeForColumnArrayImpl(byte_size, array_offsets); - } + const TiDB::TiDBCollatorPtr &) const override; void countSerializeByteSizeForColumnArray( PaddedPODArray & byte_size, - const IColumn::Offsets & array_offsets) const override - { - countSerializeByteSizeForColumnArrayImpl(byte_size, array_offsets); - } + const IColumn::Offsets & array_offsets) const override; void serializeToPosForCmp( PaddedPODArray & pos, @@ -202,20 +190,8 @@ class ColumnDecimal final : public COWPtrHelper(pos, start, length); - else - serializeToPosImpl(pos, start, length); - } - void serializeToPos(PaddedPODArray & pos, size_t start, size_t length, bool has_null) const override - { - if (has_null) - serializeToPosImpl(pos, start, length); - else - serializeToPosImpl(pos, start, length); - } + String *) const override; + void serializeToPos(PaddedPODArray & pos, size_t start, size_t length, bool has_null) const override; void serializeToPosForCmpColumnArray( PaddedPODArray & pos, @@ -224,65 +200,25 @@ class ColumnDecimal final : public COWPtrHelper( - pos, - start, - length, - array_offsets); - else - serializeToPosForColumnArrayImpl( - pos, - start, - length, - array_offsets); - } + String *) const override; void serializeToPosForColumnArray( PaddedPODArray & pos, size_t start, size_t length, bool has_null, - const IColumn::Offsets & array_offsets) const override - { - if (has_null) - serializeToPosForColumnArrayImpl( - pos, - start, - length, - array_offsets); - else - serializeToPosForColumnArrayImpl( - pos, - start, - length, - array_offsets); - } + const IColumn::Offsets & array_offsets) const override; - void deserializeForCmpAndInsertFromPos(PaddedPODArray & pos, bool use_nt_align_buffer) override - { - deserializeAndInsertFromPosImpl(pos, use_nt_align_buffer); - } - void deserializeAndInsertFromPos(PaddedPODArray & pos, bool use_nt_align_buffer) override - { - deserializeAndInsertFromPosImpl(pos, use_nt_align_buffer); - } + void deserializeForCmpAndInsertFromPos(PaddedPODArray & pos, bool use_nt_align_buffer) override; + void deserializeAndInsertFromPos(PaddedPODArray & pos, bool use_nt_align_buffer) override; void deserializeForCmpAndInsertFromPosColumnArray( PaddedPODArray & pos, const IColumn::Offsets & array_offsets, - bool use_nt_align_buffer) override - { - deserializeAndInsertFromPosForColumnArrayImpl(pos, array_offsets, use_nt_align_buffer); - } + bool use_nt_align_buffer) override; void deserializeAndInsertFromPosForColumnArray( PaddedPODArray & pos, const IColumn::Offsets & array_offsets, - bool use_nt_align_buffer) override - { - deserializeAndInsertFromPosForColumnArrayImpl(pos, array_offsets, use_nt_align_buffer); - } + bool use_nt_align_buffer) override; void flushNTAlignBuffer() override;