Skip to content

Commit

Permalink
change names
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 6, 2025
1 parent db8d490 commit 7c725cb
Show file tree
Hide file tree
Showing 18 changed files with 374 additions and 357 deletions.
55 changes: 28 additions & 27 deletions dbms/src/Columns/ColumnAggregateFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,54 +165,55 @@ class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggrega

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

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

void batchSerialize(
void serializeToPosUnique(
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 batchSerialize is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
throw Exception("Method serializeToPosUnique is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
void batchSerializeFast(
void serializeToPos(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
bool /* has_null */) const override
{
throw Exception("Method batchSerializeFast is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
throw Exception("Method serializeToPos is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED);
}
void batchSerializeForColumnArray(
void serializeToPosUniqueForColumnArray(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
Expand All @@ -222,50 +223,50 @@ class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggrega
String * /* sort_key_container */) const override
{
throw Exception(
"Method batchSerializeForColumnArray is not supported for " + getName(),
"Method serializeToPosUniqueForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void batchSerializeForColumnArrayFast(
void serializeToPosForColumnArray(
PaddedPODArray<char *> & /* pos */,
size_t /* start */,
size_t /* length */,
bool /* has_null */,
const IColumn::Offsets & /* offsets */) const override
{
throw Exception(
"Method batchSerializeForColumnArrayFast is not supported for " + getName(),
"Method serializeToPosForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}

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

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

Expand Down
37 changes: 22 additions & 15 deletions dbms/src/Columns/ColumnArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,14 @@ const char * ColumnArray::deserializeAndInsertFromArena(const char * pos, const
return pos;
}

void ColumnArray::countSerializeByteSize(PaddedPODArray<size_t> & byte_size, const TiDB::TiDBCollatorPtr & collator)
const
void ColumnArray::countSerializeByteSizeUnique(
PaddedPODArray<size_t> & byte_size,
const TiDB::TiDBCollatorPtr & collator) const
{
countSerializeByteSizeImpl<false>(byte_size, collator);
}

void ColumnArray::countSerializeByteSizeFast(PaddedPODArray<size_t> & byte_size) const
void ColumnArray::countSerializeByteSize(PaddedPODArray<size_t> & byte_size) const
{
countSerializeByteSizeImpl<true>(byte_size, nullptr);
}
Expand All @@ -251,12 +252,12 @@ void ColumnArray::countSerializeByteSizeImpl(PaddedPODArray<size_t> & byte_size,
byte_size[i] += sizeof(UInt32);

if constexpr (is_fast)
getData().countSerializeByteSizeForColumnArrayFast(byte_size, getOffsets());
getData().countSerializeByteSizeForColumnArray(byte_size, getOffsets());
else
getData().countSerializeByteSizeForColumnArray(byte_size, getOffsets(), collator);
getData().countSerializeByteSizeUniqueForColumnArray(byte_size, getOffsets(), collator);
}

void ColumnArray::batchSerialize(
void ColumnArray::serializeToPosUnique(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
Expand All @@ -270,7 +271,7 @@ void ColumnArray::batchSerialize(
batchSerializeImpl<false, false>(pos, start, length, collator, sort_key_container);
}

void ColumnArray::batchSerializeFast(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const
void ColumnArray::serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const
{
if (has_null)
batchSerializeImpl<true, true>(pos, start, length, nullptr, nullptr);
Expand All @@ -289,7 +290,7 @@ void ColumnArray::batchSerializeImpl(
RUNTIME_CHECK_MSG(length <= pos.size(), "length({}) > size of pos({})", length, pos.size());
RUNTIME_CHECK_MSG(start + length <= size(), "start({}) + length({}) > size of column({})", start, length, size());

/// countSerializeByteSize has already checked that the size of one element is not greater than UINT32_MAX
/// countSerializeByteSizeUnique has already checked that the size of one element is not greater than UINT32_MAX
for (size_t i = 0; i < length; ++i)
{
if constexpr (has_null)
Expand All @@ -303,21 +304,27 @@ void ColumnArray::batchSerializeImpl(
}

if constexpr (is_fast)
getData().batchSerializeForColumnArrayFast(pos, start, length, has_null, getOffsets());
getData().serializeToPosForColumnArray(pos, start, length, has_null, getOffsets());
else
getData()
.batchSerializeForColumnArray(pos, start, length, has_null, getOffsets(), collator, sort_key_container);
getData().serializeToPosUniqueForColumnArray(
pos,
start,
length,
has_null,
getOffsets(),
collator,
sort_key_container);
}

void ColumnArray::batchDeserialize(
void ColumnArray::batchDeserializeUnique(
PaddedPODArray<const char *> & pos,
bool use_nt_align_buffer,
const TiDB::TiDBCollatorPtr & collator)
{
batchDeserializeImpl<false>(pos, use_nt_align_buffer, collator);
}

void ColumnArray::batchDeserializeFast(PaddedPODArray<const char *> & pos, bool use_nt_align_buffer)
void ColumnArray::batchDeserialize(PaddedPODArray<const char *> & pos, bool use_nt_align_buffer)
{
batchDeserializeImpl<true>(pos, use_nt_align_buffer, nullptr);
}
Expand All @@ -342,9 +349,9 @@ void ColumnArray::batchDeserializeImpl(
}

if constexpr (is_fast)
getData().batchDeserializeForColumnArrayFast(pos, offsets, use_nt_align_buffer);
getData().batchDeserializeForColumnArray(pos, offsets, use_nt_align_buffer);
else
getData().batchDeserializeForColumnArray(pos, offsets, use_nt_align_buffer, collator);
getData().batchDeserializeUniqueForColumnArray(pos, offsets, use_nt_align_buffer, collator);
}

void ColumnArray::flushNTAlignBuffer()
Expand Down
36 changes: 18 additions & 18 deletions dbms/src/Columns/ColumnArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,38 +99,38 @@ class ColumnArray final : public COWPtrHelper<IColumn, ColumnArray>
String &) const override;
const char * deserializeAndInsertFromArena(const char * pos, const TiDB::TiDBCollatorPtr &) override;

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

void countSerializeByteSizeForColumnArray(
void countSerializeByteSizeUniqueForColumnArray(
PaddedPODArray<size_t> & /* byte_size */,
const IColumn::Offsets & /* array_offsets */,
const TiDB::TiDBCollatorPtr & /* collator */) const override
{
throw Exception(
"Method countSerializeByteSizeForColumnArray is not supported for " + getName(),
"Method countSerializeByteSizeUniqueForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}
void countSerializeByteSizeForColumnArrayFast(
void countSerializeByteSizeForColumnArray(
PaddedPODArray<size_t> & /* byte_size */,
const IColumn::Offsets & /* array_offsets */) const override
{
throw Exception(
"Method countSerializeByteSizeForColumnArrayFast is not supported for " + getName(),
"Method countSerializeByteSizeForColumnArray is not supported for " + getName(),
ErrorCodes::NOT_IMPLEMENTED);
}

void batchSerialize(
void serializeToPosUnique(
PaddedPODArray<char *> & pos,
size_t start,
size_t length,
bool has_null,
const TiDB::TiDBCollatorPtr & collator,
String * sort_key_container) const override;
void batchSerializeFast(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const override;
void serializeToPos(PaddedPODArray<char *> & pos, size_t start, size_t length, bool has_null) const override;

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

void batchDeserialize(
void batchDeserializeUnique(
PaddedPODArray<const char *> & pos,
bool use_nt_align_buffer,
const TiDB::TiDBCollatorPtr & collator) override;
void batchDeserializeFast(PaddedPODArray<const char *> & pos, bool use_nt_align_buffer) override;
void batchDeserialize(PaddedPODArray<const char *> & pos, bool use_nt_align_buffer) override;

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

Expand Down
Loading

0 comments on commit 7c725cb

Please sign in to comment.