Skip to content

Commit 9225ab0

Browse files
committed
fix pre-commit
1 parent 3aca7f5 commit 9225ab0

3 files changed

Lines changed: 19 additions & 29 deletions

File tree

src/paimon/common/data/shredding/map_shared_shredding_utils_test.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -430,16 +430,13 @@ TEST(MapSharedShreddingUtilsTest, GetPhysicalColumnIndicesMultipleFields) {
430430
meta.name_to_id = {{"a", 0}, {"b", 1}, {"c", 2}};
431431
meta.field_to_columns = {{0, {0, 1}}, {1, {2, 3, 4}}, {2, {5}}};
432432

433-
ASSERT_OK_AND_ASSIGN(auto cols_a,
434-
MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "a"));
433+
ASSERT_OK_AND_ASSIGN(auto cols_a, MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "a"));
435434
ASSERT_EQ(cols_a, (std::vector<int32_t>{0, 1}));
436435

437-
ASSERT_OK_AND_ASSIGN(auto cols_b,
438-
MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "b"));
436+
ASSERT_OK_AND_ASSIGN(auto cols_b, MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "b"));
439437
ASSERT_EQ(cols_b, (std::vector<int32_t>{2, 3, 4}));
440438

441-
ASSERT_OK_AND_ASSIGN(auto cols_c,
442-
MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "c"));
439+
ASSERT_OK_AND_ASSIGN(auto cols_c, MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "c"));
443440
ASSERT_EQ(cols_c, (std::vector<int32_t>{5}));
444441
}
445442

@@ -449,9 +446,8 @@ TEST(MapSharedShreddingUtilsTest, GetPhysicalColumnIndicesFieldNotFound) {
449446
meta.name_to_id = {{"age", 0}};
450447
meta.field_to_columns = {{0, {1}}};
451448

452-
ASSERT_NOK_WITH_MSG(
453-
MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "nonexistent"),
454-
"cannot find field nonexistent in map shared shredding meta");
449+
ASSERT_NOK_WITH_MSG(MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "nonexistent"),
450+
"cannot find field nonexistent in map shared shredding meta");
455451
}
456452

457453
// Error: field name not found in empty meta
@@ -468,9 +464,8 @@ TEST(MapSharedShreddingUtilsTest, GetPhysicalColumnIndicesFieldIdMissingInFieldT
468464
meta.name_to_id = {{"score", 42}};
469465
meta.field_to_columns = {};
470466

471-
ASSERT_NOK_WITH_MSG(
472-
MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "score"),
473-
"cannot find field id 42 in field_to_columns in map shared shredding meta");
467+
ASSERT_NOK_WITH_MSG(MapSharedShreddingUtils::GetPhysicalColumnIndices(meta, "score"),
468+
"cannot find field id 42 in field_to_columns in map shared shredding meta");
474469
}
475470

476471
TEST(MapSharedShreddingUtilsTest, IsOverflowField) {

src/paimon/common/data/shredding/shared_shredding_file_reader.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ class SharedShreddingFileReader : public FileBatchReader {
6363
const std::shared_ptr<arrow::StructArray>& physical_struct_array) const;
6464

6565
static std::vector<std::pair<std::string, int32_t>> ResolveSelectedKeyIds(
66-
const MapSharedShreddingFieldMeta& meta,
67-
const std::vector<std::string>& selected_keys);
66+
const MapSharedShreddingFieldMeta& meta, const std::vector<std::string>& selected_keys);
6867

6968
static void CollectPhysicalColumns(
7069
const std::shared_ptr<arrow::StructArray>& physical_struct_array,

src/paimon/common/data/shredding/shared_shredding_file_reader_test.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -412,24 +412,23 @@ TEST_F(SharedShreddingFileReaderTest, TestListValue) {
412412
meta.max_row_width = 3;
413413

414414
std::map<std::string, int32_t> field_to_num_columns = {{"tags", 2}};
415-
ASSERT_OK_AND_ASSIGN(auto physical_schema,
416-
MapSharedShreddingUtils::LogicalToPhysicalSchema(
417-
logical_schema, field_to_num_columns));
415+
ASSERT_OK_AND_ASSIGN(auto physical_schema, MapSharedShreddingUtils::LogicalToPhysicalSchema(
416+
logical_schema, field_to_num_columns));
418417
auto metadata = std::make_shared<arrow::KeyValueMetadata>();
419418
ASSERT_OK(MapSharedShreddingUtils::SerializeMetadata(
420419
meta, MapSharedShreddingDefine::kDefaultDictCompression, metadata.get()));
421420
arrow::FieldVector physical_fields = physical_schema->fields();
422421
physical_fields[1] = physical_fields[1]->WithMetadata(metadata);
423422
physical_schema = arrow::schema(std::move(physical_fields));
424423

425-
auto physical_array = arrow::ipc::internal::json::ArrayFromJSON(
426-
arrow::struct_(physical_schema->fields()), R"([
424+
auto physical_array =
425+
arrow::ipc::internal::json::ArrayFromJSON(arrow::struct_(physical_schema->fields()), R"([
427426
[1, [[0, 1], [1, null, 2], [3], null]],
428427
[2, [[2, 0], [5, 6], [7], null]],
429428
[3, null],
430429
[4, [[1, 0], [8], [9, 10], [[2, [null]]]]]
431430
])")
432-
.ValueOrDie();
431+
.ValueOrDie();
433432
auto reader = CreateReader(physical_array, physical_schema);
434433

435434
auto read_metadata = std::make_shared<arrow::KeyValueMetadata>();
@@ -489,12 +488,10 @@ TEST_F(SharedShreddingFileReaderTest, TestOrcDictionaryEncodedStringValue) {
489488

490489
std::string data_file_path =
491490
path_factory->ToPath(inc.GetNewFilesIncrement().NewFiles()[0]->file_name);
492-
std::map<std::string, std::string> reader_options = {
493-
{"orc.read.enable-lazy-decoding", "true"}};
494-
ASSERT_OK_AND_ASSIGN(
495-
auto reader,
496-
SharedShreddingFileReader::Create(
497-
OpenFormatReader(data_file_path, format, reader_options), pool_));
491+
std::map<std::string, std::string> reader_options = {{"orc.read.enable-lazy-decoding", "true"}};
492+
ASSERT_OK_AND_ASSIGN(auto reader,
493+
SharedShreddingFileReader::Create(
494+
OpenFormatReader(data_file_path, format, reader_options), pool_));
498495

499496
auto read_metadata = std::make_shared<arrow::KeyValueMetadata>();
500497
read_metadata->Append("paimon.map.selected-keys", "a,c");
@@ -548,9 +545,8 @@ TEST_F(SharedShreddingFileReaderTest, TestReadsRealFormatFile) {
548545

549546
std::string data_file_path =
550547
path_factory->ToPath(inc.GetNewFilesIncrement().NewFiles()[0]->file_name);
551-
ASSERT_OK_AND_ASSIGN(auto reader,
552-
SharedShreddingFileReader::Create(
553-
OpenFormatReader(data_file_path, format), pool_));
548+
ASSERT_OK_AND_ASSIGN(auto reader, SharedShreddingFileReader::Create(
549+
OpenFormatReader(data_file_path, format), pool_));
554550

555551
auto read_schema = ExportSchema(ReadSchema("a,c"));
556552
ASSERT_OK(reader->SetReadSchema(read_schema.get(), /*predicate=*/nullptr,

0 commit comments

Comments
 (0)