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 26, 2025
1 parent eb01d9e commit 62fbbed
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dbms/src/Columns/ColumnArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void ColumnArray::serializeToPosImpl(
RUNTIME_CHECK_MSG(start + length <= size(), "start({}) + length({}) > size of column({})", start, length, size());

static_assert(!(has_null && has_nullmap));
assert(!has_nullmap || (nullmap && nullmap->size() == size()));
RUNTIME_CHECK(!has_nullmap || (nullmap && nullmap->size() == size()));

/// countSerializeByteSize has already checked that the size of one element is not greater than UINT32_MAX
for (size_t i = 0; i < length; ++i)
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Columns/ColumnDecimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void ColumnDecimal<T>::serializeToPosImpl(
RUNTIME_CHECK_MSG(start + length <= size(), "start({}) + length({}) > size of column({})", start, length, size());

static_assert(!(has_null && has_nullmap));
assert(!has_nullmap || (nullmap && nullmap->size() == size()));
RUNTIME_CHECK(!has_nullmap || (nullmap && nullmap->size() == size()));

T def_val{};
for (size_t i = 0; i < length; ++i)
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Columns/ColumnFixedString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void ColumnFixedString::serializeToPosImpl(
RUNTIME_CHECK_MSG(start + length <= size(), "start({}) + length({}) > size of column({})", start, length, size());

static_assert(!(has_null && has_nullmap));
assert(!has_nullmap || (nullmap && nullmap->size() == size()));
RUNTIME_CHECK(!has_nullmap || (nullmap && nullmap->size() == size()));

for (size_t i = 0; i < length; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Columns/ColumnString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ void ColumnString::serializeToPosImpl(
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());

assert(!has_nullmap || (nullmap && nullmap->size() == size()));
RUNTIME_CHECK(!has_nullmap || (nullmap && nullmap->size() == size()));

/// To avoid virtual function call of sortKey().
const auto * derived_collator = static_cast<const DerivedCollator *>(collator);
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Columns/ColumnVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void ColumnVector<T>::serializeToPosImpl(
RUNTIME_CHECK_MSG(start + length <= size(), "start({}) + length({}) > size of column({})", start, length, size());

static_assert(!(has_null && has_nullmap));
assert(!has_nullmap || (nullmap && nullmap->size() == size()));
RUNTIME_CHECK(!has_nullmap || (nullmap && nullmap->size() == size()));

T def_val{};
for (size_t i = 0; i < length; ++i)
Expand Down
13 changes: 0 additions & 13 deletions dbms/src/Columns/tests/gtest_column_serialize_deserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,6 @@ class TestColumnSerializeDeserialize : public ::testing::Test
}
}
}
// else if (result_col_ptr->getFamilyName() == String("Nullable"))
// {
// for (size_t i = 0; i < result_col_ptr->size(); ++i)
// {
// ASSERT_EQ(result_col_ptr->isNullAt(i), new_col_ptr->isNullAt(i));
// }
// const auto & nested_result_col_ptr = checkAndGetColumn<ColumnNullable>(result_col_ptr.get())->getNestedColumnPtr();
// const auto & nested_new_col_ptr = checkAndGetColumn<ColumnNullable>(new_col_ptr.get())->getNestedColumnPtr();
// checkForColumnWithCollator(
// nested_result_col_ptr,
// nested_new_col_ptr,
// collator);
// }
else
{
for (size_t i = 0; i < result_col_ptr->size(); ++i)
Expand Down

0 comments on commit 62fbbed

Please sign in to comment.