Skip to content

Commit

Permalink
fix format:
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Dec 30, 2024
1 parent 50cbaa3 commit d3c00d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
7 changes: 5 additions & 2 deletions be/test/vec/data_types/common_data_type_serder_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <filesystem>
#include <fstream>
#include <iostream>

#include "arrow/type.h"
#include "runtime/descriptors.h"
#include "util/arrow/block_convertor.h"
Expand Down Expand Up @@ -370,8 +371,10 @@ class CommonDataTypeSerdeTest : public ::testing::Test {
array.get(), 0, column_with_type_and_name.column,
column_with_type_and_name.type, rows, _timezone_obj);
// do check data
std::cout << "arrow_column_to_doris_column done: " << column_with_type_and_name.column->get_name()
<< " with column size: " << column_with_type_and_name.column->size() <<std::endl;
std::cout << "arrow_column_to_doris_column done: "
<< column_with_type_and_name.column->get_name()
<< " with column size: " << column_with_type_and_name.column->size()
<< std::endl;
std::cout << assert_block.dump_structure() << std::endl;
EXPECT_EQ(Status::OK(), ret) << "convert arrow to block failed" << ret.to_string();
auto& col = block->get_by_position(i).column;
Expand Down
18 changes: 11 additions & 7 deletions be/test/vec/data_types/common_data_type_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ class CommonDataTypeTest : public ::testing::Test {
if (auto st = serders[c_idx]->deserialize_one_cell_from_json(
*columns[c_idx], string_slice, options);
!st.ok()) {
std::cout << "error in deserialize but continue: " << st.to_string() << std::endl;
std::cout << "error in deserialize but continue: " << st.to_string()
<< std::endl;
}
++c_idx;
}
Expand Down Expand Up @@ -132,8 +133,9 @@ class CommonDataTypeTest : public ::testing::Test {
ASSERT_EQ(data_type->text_can_contain_only_valid_utf8(),
meta_info.text_can_contain_only_valid_utf8);
ASSERT_EQ(data_type->have_maximum_size_of_value(), meta_info.have_maximum_size_of_value);
if (is_decimal(data_type) || data_type->is_nullable() || is_struct(data_type)
|| is_nothing(data_type) || is_number(data_type) || is_columned_as_number(data_type) || is_ip(data_type)) {
if (is_decimal(data_type) || data_type->is_nullable() || is_struct(data_type) ||
is_nothing(data_type) || is_number(data_type) || is_columned_as_number(data_type) ||
is_ip(data_type)) {
ASSERT_EQ(data_type->get_size_of_value_in_memory(), meta_info.size_of_value_in_memory);
} else {
EXPECT_ANY_THROW(EXPECT_FALSE(data_type->get_size_of_value_in_memory()));
Expand All @@ -152,7 +154,8 @@ class CommonDataTypeTest : public ::testing::Test {
}

// create column assert with default field is simple and can be used for all DataType
void create_column_assert(DataTypePtr& data_type, Field& default_field, size_t uncompressed_serialized_bytes = -1) {
void create_column_assert(DataTypePtr& data_type, Field& default_field,
size_t uncompressed_serialized_bytes = -1) {
std::cout << "create_column_assert: " << data_type->get_name() << std::endl;
auto column = data_type->create_column();
ASSERT_EQ(column->size(), 0);
Expand All @@ -164,7 +167,8 @@ class CommonDataTypeTest : public ::testing::Test {
ASSERT_EQ(const_col->operator[](i), default_const_col->operator[](i));
}
// get_uncompressed_serialized_bytes
ASSERT_EQ(data_type->get_uncompressed_serialized_bytes(*column, 0), uncompressed_serialized_bytes);
ASSERT_EQ(data_type->get_uncompressed_serialized_bytes(*column, 0),
uncompressed_serialized_bytes);
}

// get_field assert is simple and can be used for all DataType
Expand All @@ -187,7 +191,6 @@ class CommonDataTypeTest : public ::testing::Test {
// to_string | to_string_batch | from_string assert is simple and can be used for all DataType
void assert_to_string_from_string_assert(MutableColumnPtr mutableColumn,
DataTypePtr& data_type) {

{
// to_string_batch | from_string
auto col_to = ColumnString::create();
Expand All @@ -206,7 +209,8 @@ class CommonDataTypeTest : public ::testing::Test {
}
}
{
std::cout << "assert to_string from_string is reciprocal: " << data_type->get_name() << std::endl;
std::cout << "assert to_string from_string is reciprocal: " << data_type->get_name()
<< std::endl;
// to_string | from_string
auto ser_col = ColumnString::create();
ser_col->reserve(mutableColumn->size());
Expand Down

0 comments on commit d3c00d7

Please sign in to comment.