Skip to content

Commit 0f3cc90

Browse files
committed
refactor: Initialize parquet_logical_type to nullptr and add empty metadata in WriteArray
1 parent f6bdefb commit 0f3cc90

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/iceberg/test/parquet_schema_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ TEST(ParquetSchemaProjectionTest, ProjectPrimitiveType) {
520520
struct TestCase {
521521
std::shared_ptr<Type> iceberg_type;
522522
::parquet::Type::type parquet_type;
523-
std::shared_ptr<const ::parquet::LogicalType> parquet_logical_type;
523+
std::shared_ptr<const ::parquet::LogicalType> parquet_logical_type = nullptr;
524524
int32_t primitive_length = -1;
525525
};
526526

@@ -591,7 +591,7 @@ TEST(ParquetSchemaProjectionTest, UnsuportedProjection) {
591591
struct TestCase {
592592
std::shared_ptr<Type> iceberg_type;
593593
::parquet::Type::type parquet_type;
594-
std::shared_ptr<const ::parquet::LogicalType> parquet_logical_type;
594+
std::shared_ptr<const ::parquet::LogicalType> parquet_logical_type = nullptr;
595595
int32_t primitive_length = -1;
596596
};
597597

src/iceberg/test/parquet_test.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class ParquetReaderTest : public ::testing::Test {
153153
ASSERT_TRUE(WriteArray(array, {.path = temp_parquet_file_,
154154
.schema = schema,
155155
.io = file_io_,
156+
.metadata = {},
156157
.properties = std::move(writer_properties)}));
157158
}
158159

@@ -417,7 +418,11 @@ TEST_F(ParquetReadWrite, EmptyStruct) {
417418
std::shared_ptr<FileIO> file_io = arrow::ArrowFileSystemFileIO::MakeMockFileIO();
418419
const std::string basePath = "base.parquet";
419420

420-
ASSERT_THAT(WriteArray(array, {.path = basePath, .schema = schema, .io = file_io}),
421+
ASSERT_THAT(WriteArray(array, {.path = basePath,
422+
.schema = schema,
423+
.io = file_io,
424+
.metadata = {},
425+
.properties = {}}),
421426
IsError(ErrorKind::kNotImplemented));
422427
}
423428

0 commit comments

Comments
 (0)