HuaHuaY commented on code in PR #198:
URL: https://github.com/apache/iceberg-cpp/pull/198#discussion_r2314827268
##########
test/parquet_test.cc:
##########
@@ -204,4 +280,85 @@ TEST_F(ParquetReaderTest, ReadSplit) {
}
}
+class ParquetReadWrite : public ::testing::Test {
+ protected:
+ static void SetUpTestSuite() { parquet::RegisterAll(); }
+};
+
+TEST_F(ParquetReadWrite, EmptyStruct) {
+ auto schema =
+
std::make_shared<Schema>(std::vector<SchemaField>{SchemaField::MakeRequired(
+ 1, "empty_struct",
std::make_shared<StructType>(std::vector<SchemaField>{}))});
+
+ ArrowSchema arrow_c_schema;
+ ASSERT_THAT(ToArrowSchema(*schema, &arrow_c_schema), IsOk());
+ auto arrow_schema = ::arrow::ImportType(&arrow_c_schema).ValueOrDie();
+
+ auto array = ::arrow::json::ArrayFromJSONString(
+ ::arrow::struct_(arrow_schema->fields()), R"([null, {}])")
+ .ValueOrDie();
+
+ std::shared_ptr<FileIO> file_io =
arrow::ArrowFileSystemFileIO::MakeMockFileIO();
+ const std::string basePath = "base.parquet";
+
+ ASSERT_THAT(WriteTable(array, {.path = basePath, .schema = schema, .io =
file_io}),
+ IsError(ErrorKind::kUnknownError));
Review Comment:
`ToErrorKind(const ::arrow::Status& status)` in
`arrow_error_transform_internal.h` only maps arrow's IOError to iceberg's
ErrorKind. I add a NotImplemented mapping first and will open another PR to
organize errorcode mappings.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]