Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compilation error on arm64 #9839

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 131 additions & 1 deletion dbms/src/Columns/ColumnDecimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,137 @@ const char * ColumnDecimal<T>::deserializeAndInsertFromArena(const char * pos, c
}
}

template <typename T>
void ColumnDecimal<T>::countSerializeByteSizeForCmp(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr &) const
{
countSerializeByteSizeImpl<true>(byte_size);
}

template <typename T>
void ColumnDecimal<T>::countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const
{
countSerializeByteSizeImpl<false>(byte_size);
}


template <typename T>
void ColumnDecimal<T>::countSerializeByteSizeForCmpColumnArray(
PaddedPODArray<size_t> & byte_size,
const IColumn::Offsets & array_offsets,
const TiDB::TiDBCollatorPtr &) const
{
countSerializeByteSizeForColumnArrayImpl<true>(byte_size, array_offsets);
}

template <typename T>
void ColumnDecimal<T>::countSerializeByteSizeForColumnArray(
PaddedPODArray<size_t> & byte_size,
const IColumn::Offsets & array_offsets) const
{
countSerializeByteSizeForColumnArrayImpl<false>(byte_size, array_offsets);
}


template <typename T>
void ColumnDecimal<T>::serializeToPosForCmp(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
bool has_null,
const TiDB::TiDBCollatorPtr &,
String *) const
{
if (has_null)
serializeToPosImpl</*has_null=*/true, /*for_compare=*/true>(pos, start, length);
else
serializeToPosImpl</*has_null=*/false, /*for_compare=*/true>(pos, start, length);
}

template <typename T>
void ColumnDecimal<T>::serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const
{
if (has_null)
serializeToPosImpl</*has_null=*/true, /*for_compare=*/false>(pos, start, length);
else
serializeToPosImpl</*has_null=*/false, /*for_compare=*/false>(pos, start, length);
}

template <typename T>
void ColumnDecimal<T>::serializeToPosForCmpColumnArray(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
bool has_null,
const IColumn::Offsets & array_offsets,
const TiDB::TiDBCollatorPtr &,
String *) const
{
if (has_null)
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/true>(
pos,
start,
length,
array_offsets);
else
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/true>(
pos,
start,
length,
array_offsets);
}

template <typename T>
void ColumnDecimal<T>::serializeToPosForColumnArray(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
bool has_null,
const IColumn::Offsets & array_offsets) const
{
if (has_null)
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/false>(
pos,
start,
length,
array_offsets);
else
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/false>(
pos,
start,
length,
array_offsets);
}

template <typename T>
void ColumnDecimal<T>::deserializeForCmpAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer)
{
deserializeAndInsertFromPosImpl<true>(pos, use_nt_align_buffer);
}

template <typename T>
void ColumnDecimal<T>::deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer)
{
deserializeAndInsertFromPosImpl<false>(pos, use_nt_align_buffer);
}

template <typename T>
void ColumnDecimal<T>::deserializeForCmpAndInsertFromPosColumnArray(
PaddedPODArray<char *> & pos,
const IColumn::Offsets & array_offsets,
bool use_nt_align_buffer)
{
deserializeAndInsertFromPosForColumnArrayImpl<true>(pos, array_offsets, use_nt_align_buffer);
}

template <typename T>
void ColumnDecimal<T>::deserializeAndInsertFromPosForColumnArray(
PaddedPODArray<char *> & pos,
const IColumn::Offsets & array_offsets,
bool use_nt_align_buffer)
{
deserializeAndInsertFromPosForColumnArrayImpl<false>(pos, array_offsets, use_nt_align_buffer);
}

template <typename T>
template <bool for_compare>
void ColumnDecimal<T>::countSerializeByteSizeImpl(PaddedPODArray<size_t> & byte_size) const
Expand All @@ -160,7 +291,6 @@ void ColumnDecimal<T>::countSerializeByteSizeImpl(PaddedPODArray<size_t> & byte_
}
}

// TODO add unit test
template <typename T>
template <bool for_compare>
void ColumnDecimal<T>::countSerializeByteSizeForColumnArrayImpl(
Expand Down
88 changes: 12 additions & 76 deletions dbms/src/Columns/ColumnDecimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,49 +173,25 @@ class ColumnDecimal final : public COWPtrHelper<ColumnVectorHelper, ColumnDecima
String &) const override;
const char * deserializeAndInsertFromArena(const char * pos, const TiDB::TiDBCollatorPtr &) override;

void countSerializeByteSizeForCmp(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr &) const override
{
countSerializeByteSizeImpl<true>(byte_size);
}
void countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const override
{
countSerializeByteSizeImpl<false>(byte_size);
}
void countSerializeByteSizeForCmp(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr &) const override;
void countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const override;

void countSerializeByteSizeForCmpColumnArray(
PaddedPODArray<size_t> & byte_size,
const IColumn::Offsets & array_offsets,
const TiDB::TiDBCollatorPtr &) const override
{
countSerializeByteSizeForColumnArrayImpl<true>(byte_size, array_offsets);
}
const TiDB::TiDBCollatorPtr &) const override;
void countSerializeByteSizeForColumnArray(
PaddedPODArray<size_t> & byte_size,
const IColumn::Offsets & array_offsets) const override
{
countSerializeByteSizeForColumnArrayImpl<false>(byte_size, array_offsets);
}
const IColumn::Offsets & array_offsets) const override;

void serializeToPosForCmp(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
bool has_null,
const TiDB::TiDBCollatorPtr &,
String *) const override
{
if (has_null)
serializeToPosImpl</*has_null=*/true, /*for_compare=*/true>(pos, start, length);
else
serializeToPosImpl</*has_null=*/false, /*for_compare=*/true>(pos, start, length);
}
void serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const override
{
if (has_null)
serializeToPosImpl</*has_null=*/true, /*for_compare=*/false>(pos, start, length);
else
serializeToPosImpl</*has_null=*/false, /*for_compare=*/false>(pos, start, length);
}
String *) const override;
void serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const override;

void serializeToPosForCmpColumnArray(
PaddedPODArray<char *> & pos,
Expand All @@ -224,65 +200,25 @@ class ColumnDecimal final : public COWPtrHelper<ColumnVectorHelper, ColumnDecima
bool has_null,
const IColumn::Offsets & array_offsets,
const TiDB::TiDBCollatorPtr &,
String *) const override
{
if (has_null)
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/true>(
pos,
start,
length,
array_offsets);
else
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/true>(
pos,
start,
length,
array_offsets);
}
String *) const override;
void serializeToPosForColumnArray(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
bool has_null,
const IColumn::Offsets & array_offsets) const override
{
if (has_null)
serializeToPosForColumnArrayImpl</*has_null=*/true, /*for_compare=*/false>(
pos,
start,
length,
array_offsets);
else
serializeToPosForColumnArrayImpl</*has_null=*/false, /*for_compare=*/false>(
pos,
start,
length,
array_offsets);
}
const IColumn::Offsets & array_offsets) const override;

void deserializeForCmpAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override
{
deserializeAndInsertFromPosImpl<true>(pos, use_nt_align_buffer);
}
void deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override
{
deserializeAndInsertFromPosImpl<false>(pos, use_nt_align_buffer);
}
void deserializeForCmpAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override;
void deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override;

void deserializeForCmpAndInsertFromPosColumnArray(
PaddedPODArray<char *> & pos,
const IColumn::Offsets & array_offsets,
bool use_nt_align_buffer) override
{
deserializeAndInsertFromPosForColumnArrayImpl<true>(pos, array_offsets, use_nt_align_buffer);
}
bool use_nt_align_buffer) override;
void deserializeAndInsertFromPosForColumnArray(
PaddedPODArray<char *> & pos,
const IColumn::Offsets & array_offsets,
bool use_nt_align_buffer) override
{
deserializeAndInsertFromPosForColumnArrayImpl<false>(pos, array_offsets, use_nt_align_buffer);
}
bool use_nt_align_buffer) override;

void flushNTAlignBuffer() override;

Expand Down