Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
Signed-off-by: guo-shaoge <[email protected]>
  • Loading branch information
guo-shaoge committed Jan 10, 2025
1 parent 7d910e5 commit 8070321
Show file tree
Hide file tree
Showing 19 changed files with 232 additions and 233 deletions.
32 changes: 16 additions & 16 deletions dbms/src/Columns/ColumnAggregateFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,25 @@ class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggrega

const char * deserializeAndInsertFromArena(const char * src_arena, const TiDB::TiDBCollatorPtr &) override;

void countSerializeByteSizeUnique(
void countSerializeForCmpByteSize(
PaddedPODArray<size_t> & /* byte_size */,
const TiDB::TiDBCollatorPtr & /* collator */) const override
{
throw Exception(
"Method countSerializeByteSizeUnique is not supported for " + getName(),
"Method countSerializeForCmpByteSize is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void countSerializeByteSize(PaddedPODArray<size_t> & /* byte_size */) const override
{
throw Exception("Method countSerializeByteSize is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
void countSerializeByteSizeUniqueForColumnArray(
void countSerializeForCmpByteSizeForColumnArray(
PaddedPODArray<size_t> & /* byte_size */,
const IColumn::Offsets & /* offsets */,
const TiDB::TiDBCollatorPtr & /* collator */) const override
{
throw Exception(
"Method countSerializeByteSizeUniqueForColumnArray is not supported for " + getName(),
"Method countSerializeForCmpByteSizeForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void countSerializeByteSizeForColumnArray(
Expand All @@ -195,15 +195,15 @@ class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggrega
ErrorCodes::NOT_IMPLEMENTED);
}

void serializeToPosUnique(
void serializeForCmpToPos(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
bool /* has_null */,
const TiDB::TiDBCollatorPtr & /* collator */,
String * /* sort_key_container */) const override
{
throw Exception("Method serializeToPosUnique is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
throw Exception("Method serializeForCmpToPos is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
void serializeToPos(
PaddedPODArray<char *> & /* pos */,
Expand All @@ -213,7 +213,7 @@ class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggrega
{
throw Exception("Method serializeToPos is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
void serializeToPosUniqueForColumnArray(
void serializeForCmpToPosForColumnArray(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
Expand All @@ -223,7 +223,7 @@ class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggrega
String * /* sort_key_container */) const override
{
throw Exception(
"Method serializeToPosUniqueForColumnArray is not supported for " + getName(),
"Method serializeForCmpToPosForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void serializeToPosForColumnArray(
Expand All @@ -238,34 +238,34 @@ class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggrega
ErrorCodes::NOT_IMPLEMENTED);
}

void deserializeAndInsertFromPosUnique(
PaddedPODArray<const char *> & /* pos */,
void deserializeForCmpAndInsertFromPos(
PaddedPODArray<char *> & /* pos */,
bool /* use_nt_align_buffer */,
const TiDB::TiDBCollatorPtr & /* collator */) override
{
throw Exception(
"Method deserializeAndInsertFromPosUnique is not supported for " + getName(),
"Method deserializeForCmpAndInsertFromPos is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void deserializeAndInsertFromPos(PaddedPODArray<const char *> & /* pos */, bool /* use_nt_align_buffer */) override
void deserializeAndInsertFromPos(PaddedPODArray<char *> & /* pos */, bool /* use_nt_align_buffer */) override
{
throw Exception(
"Method deserializeAndInsertFromPos is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}

void deserializeAndInsertFromPosUniqueForColumnArray(
PaddedPODArray<const char *> & /* pos */,
void deserializeForCmpAndInsertFromPosForColumnArray(
PaddedPODArray<char *> & /* pos */,
const IColumn::Offsets & /* array_offsets */,
bool /* use_nt_align_buffer */,
const TiDB::TiDBCollatorPtr & /* collator */) override
{
throw Exception(
"Method deserializeAndInsertFromPosUniqueForColumnArray is not supported for " + getName(),
"Method deserializeForCmpAndInsertFromPosForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void deserializeAndInsertFromPosForColumnArray(
PaddedPODArray<const char *> & /* pos */,
PaddedPODArray<char *> & /* pos */,
const IColumn::Offsets & /* array_offsets */,
bool /* use_nt_align_buffer */) override
{
Expand Down
18 changes: 9 additions & 9 deletions dbms/src/Columns/ColumnArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const char * ColumnArray::deserializeAndInsertFromArena(const char * pos, const
return pos;
}

void ColumnArray::countSerializeByteSizeUnique(
void ColumnArray::countSerializeForCmpByteSize(
PaddedPODArray<size_t> & byte_size,
const TiDB::TiDBCollatorPtr & collator) const
{
Expand Down Expand Up @@ -252,12 +252,12 @@ void ColumnArray::countSerializeByteSizeImpl(PaddedPODArray<size_t> & byte_size,
byte_size[i] += sizeof(UInt32);

if constexpr (ensure_unique)
getData().countSerializeByteSizeUniqueForColumnArray(byte_size, getOffsets(), collator);
getData().countSerializeForCmpByteSizeForColumnArray(byte_size, getOffsets(), collator);
else
getData().countSerializeByteSizeForColumnArray(byte_size, getOffsets());
}

void ColumnArray::serializeToPosUnique(
void ColumnArray::serializeForCmpToPos(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
Expand Down Expand Up @@ -304,7 +304,7 @@ void ColumnArray::serializeToPosImpl(
}

if constexpr (ensure_unique)
getData().serializeToPosUniqueForColumnArray(
getData().serializeForCmpToPosForColumnArray(
pos,
start,
length,
Expand All @@ -316,22 +316,22 @@ void ColumnArray::serializeToPosImpl(
getData().serializeToPosForColumnArray(pos, start, length, has_null, getOffsets());
}

void ColumnArray::deserializeAndInsertFromPosUnique(
PaddedPODArray<const char *> & pos,
void ColumnArray::deserializeForCmpAndInsertFromPos(
PaddedPODArray<char *> & pos,
bool use_nt_align_buffer,
const TiDB::TiDBCollatorPtr & collator)
{
deserializeAndInsertFromPosImpl<true>(pos, use_nt_align_buffer, collator);
}

void ColumnArray::deserializeAndInsertFromPos(PaddedPODArray<const char *> & pos, bool use_nt_align_buffer)
void ColumnArray::deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer)
{
deserializeAndInsertFromPosImpl<false>(pos, use_nt_align_buffer, nullptr);
}

template <bool ensure_unique>
void ColumnArray::deserializeAndInsertFromPosImpl(
PaddedPODArray<const char *> & pos,
PaddedPODArray<char *> & pos,
bool use_nt_align_buffer,
const TiDB::TiDBCollatorPtr & collator)
{
Expand All @@ -349,7 +349,7 @@ void ColumnArray::deserializeAndInsertFromPosImpl(
}

if constexpr (ensure_unique)
getData().deserializeAndInsertFromPosUniqueForColumnArray(pos, offsets, use_nt_align_buffer, collator);
getData().deserializeForCmpAndInsertFromPosForColumnArray(pos, offsets, use_nt_align_buffer, collator);
else
getData().deserializeAndInsertFromPosForColumnArray(pos, offsets, use_nt_align_buffer);
}
Expand Down
28 changes: 14 additions & 14 deletions dbms/src/Columns/ColumnArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ColumnArray final : public COWPtrHelper<IColumn, ColumnArray>

template <bool ensure_unique>
void deserializeAndInsertFromPosImpl(
PaddedPODArray<const char *> & pos,
PaddedPODArray<char *> & pos,
bool use_nt_align_buffer,
const TiDB::TiDBCollatorPtr & collator);

Expand Down Expand Up @@ -99,17 +99,17 @@ class ColumnArray final : public COWPtrHelper<IColumn, ColumnArray>
String &) const override;
const char * deserializeAndInsertFromArena(const char * pos, const TiDB::TiDBCollatorPtr &) override;

void countSerializeByteSizeUnique(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr & collator)
void countSerializeForCmpByteSize(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr & collator)
const override;
void countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const override;

void countSerializeByteSizeUniqueForColumnArray(
void countSerializeForCmpByteSizeForColumnArray(
PaddedPODArray<size_t> & /* byte_size */,
const IColumn::Offsets & /* array_offsets */,
const TiDB::TiDBCollatorPtr & /* collator */) const override
{
throw Exception(
"Method countSerializeByteSizeUniqueForColumnArray is not supported for " + getName(),
"Method countSerializeForCmpByteSizeForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void countSerializeByteSizeForColumnArray(
Expand All @@ -121,7 +121,7 @@ class ColumnArray final : public COWPtrHelper<IColumn, ColumnArray>
ErrorCodes::NOT_IMPLEMENTED);
}

void serializeToPosUnique(
void serializeForCmpToPos(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
Expand All @@ -130,7 +130,7 @@ class ColumnArray final : public COWPtrHelper<IColumn, ColumnArray>
String * sort_key_container) const override;
void serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const override;

void serializeToPosUniqueForColumnArray(
void serializeForCmpToPosForColumnArray(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
Expand All @@ -140,7 +140,7 @@ class ColumnArray final : public COWPtrHelper<IColumn, ColumnArray>
String * /* sort_key_container */) const override
{
throw Exception(
"Method serializeToPosUniqueForColumnArray is not supported for " + getName(),
"Method serializeForCmpToPosForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void serializeToPosForColumnArray(
Expand All @@ -155,24 +155,24 @@ class ColumnArray final : public COWPtrHelper<IColumn, ColumnArray>
ErrorCodes::NOT_IMPLEMENTED);
}

void deserializeAndInsertFromPosUnique(
PaddedPODArray<const char *> & pos,
void deserializeForCmpAndInsertFromPos(
PaddedPODArray<char *> & pos,
bool use_nt_align_buffer,
const TiDB::TiDBCollatorPtr & collator) override;
void deserializeAndInsertFromPos(PaddedPODArray<const char *> & pos, bool use_nt_align_buffer) override;
void deserializeAndInsertFromPos(PaddedPODArray<char *> & pos, bool use_nt_align_buffer) override;

void deserializeAndInsertFromPosUniqueForColumnArray(
PaddedPODArray<const char *> & /* pos */,
void deserializeForCmpAndInsertFromPosForColumnArray(
PaddedPODArray<char *> & /* pos */,
const IColumn::Offsets & /* array_offsets */,
bool /* use_nt_align_buffer */,
const TiDB::TiDBCollatorPtr & /* collator */) override
{
throw Exception(
"Method deserializeAndInsertFromPosUniqueForColumnArray is not supported for " + getName(),
"Method deserializeForCmpAndInsertFromPosForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void deserializeAndInsertFromPosForColumnArray(
PaddedPODArray<const char *> & /* pos */,
PaddedPODArray<char *> & /* pos */,
const IColumn::Offsets & /* array_offsets */,
bool /* use_nt_align_buffer */) override
{
Expand Down
32 changes: 16 additions & 16 deletions dbms/src/Columns/ColumnConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,26 @@ class ColumnConst final : public COWPtrHelper<IColumn, ColumnConst>
return res;
}

void countSerializeByteSizeUnique(
void countSerializeForCmpByteSize(
PaddedPODArray<size_t> & /* byte_size */,
const TiDB::TiDBCollatorPtr & /* collator */) const override
{
throw Exception(
"Method countSerializeByteSizeUnique is not supported for " + getName(),
"Method countSerializeForCmpByteSize is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void countSerializeByteSize(PaddedPODArray<size_t> & /* byte_size */) const override
{
throw Exception("Method countSerializeByteSize is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}

void countSerializeByteSizeUniqueForColumnArray(
void countSerializeForCmpByteSizeForColumnArray(
PaddedPODArray<size_t> & /* byte_size */,
const IColumn::Offsets & /* array_offsets */,
const TiDB::TiDBCollatorPtr & /* collaotr */) const override
{
throw Exception(
"Method countSerializeByteSizeUniqueForColumnArray is not supported for " + getName(),
"Method countSerializeForCmpByteSizeForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void countSerializeByteSizeForColumnArray(
Expand All @@ -143,15 +143,15 @@ class ColumnConst final : public COWPtrHelper<IColumn, ColumnConst>
ErrorCodes::NOT_IMPLEMENTED);
}

void serializeToPosUnique(
void serializeForCmpToPos(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
bool /* has_null */,
const TiDB::TiDBCollatorPtr & /* collator */,
String * /* sort_key_container */) const override
{
throw Exception("Method serializeToPosUnique is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
throw Exception("Method serializeForCmpToPos is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
void serializeToPos(
PaddedPODArray<char *> & /* pos */,
Expand All @@ -162,7 +162,7 @@ class ColumnConst final : public COWPtrHelper<IColumn, ColumnConst>
throw Exception("Method serializeToPos is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}

void serializeToPosUniqueForColumnArray(
void serializeForCmpToPosForColumnArray(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
Expand All @@ -172,7 +172,7 @@ class ColumnConst final : public COWPtrHelper<IColumn, ColumnConst>
String * /* sort_key_container */) const override
{
throw Exception(
"Method serializeToPosUniqueForColumnArray is not supported for " + getName(),
"Method serializeForCmpToPosForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void serializeToPosForColumnArray(
Expand All @@ -187,34 +187,34 @@ class ColumnConst final : public COWPtrHelper<IColumn, ColumnConst>
ErrorCodes::NOT_IMPLEMENTED);
}

void deserializeAndInsertFromPosUnique(
PaddedPODArray<const char *> & /* pos */,
void deserializeForCmpAndInsertFromPos(
PaddedPODArray<char *> & /* pos */,
bool /* use_nt_align_buffer */,
const TiDB::TiDBCollatorPtr & /* collator */) override
{
throw Exception(
"Method deserializeAndInsertFromPosUnique is not supported for " + getName(),
"Method deserializeForCmpAndInsertFromPos is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void deserializeAndInsertFromPos(PaddedPODArray<const char *> & /* pos */, bool /* use_nt_align_buffer */) override
void deserializeAndInsertFromPos(PaddedPODArray<char *> & /* pos */, bool /* use_nt_align_buffer */) override
{
throw Exception(
"Method deserializeAndInsertFromPos is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}

void deserializeAndInsertFromPosUniqueForColumnArray(
PaddedPODArray<const char *> & /* pos */,
void deserializeForCmpAndInsertFromPosForColumnArray(
PaddedPODArray<char *> & /* pos */,
const IColumn::Offsets & /* array_offsets */,
bool /* use_nt_align_buffer */,
const TiDB::TiDBCollatorPtr & /* collator */) override
{
throw Exception(
"Method deserializeAndInsertFromPosUniqueForColumnArray is not supported for " + getName(),
"Method deserializeForCmpAndInsertFromPosForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void deserializeAndInsertFromPosForColumnArray(
PaddedPODArray<const char *> & /* pos */,
PaddedPODArray<char *> & /* pos */,
const IColumn::Offsets & /* array_offsets */,
bool /* use_nt_align_buffer */) override
{
Expand Down
Loading

0 comments on commit 8070321

Please sign in to comment.