fairytale0828 commented on code in PR #1044:
URL: https://github.com/apache/iceberg-cpp/pull/1044#discussion_r4332372163
##########
src/iceberg/parquet/parquet_reader.cc:
##########
@@ -59,19 +59,23 @@ Result<std::shared_ptr<::arrow::io::RandomAccessFile>>
OpenInputStream(
}
Result<SchemaProjection> BuildProjection(::parquet::arrow::FileReader* reader,
- const Schema& read_schema) {
+ const Schema& read_schema,
+ const NameMapping* name_mapping) {
auto metadata = reader->parquet_reader()->metadata();
- if (!HasFieldIds(metadata->schema()->schema_root())) {
- // TODO(gangwu): apply name mapping to Parquet schema
- return NotImplemented("Applying name mapping to Parquet schema is not
implemented");
- }
-
::parquet::arrow::SchemaManifest schema_manifest;
ICEBERG_ARROW_RETURN_NOT_OK(::parquet::arrow::SchemaManifest::Make(
metadata->schema(), metadata->key_value_metadata(), reader->properties(),
&schema_manifest));
+ if (!HasFieldIds(metadata->schema()->schema_root())) {
+ if (name_mapping == nullptr) {
+ return InvalidSchema(
Review Comment:
Good catch. I'd like to keep this PR scoped to name mapping. The no-mapping
case currently matches the C++ Avro reader, which also returns InvalidSchema.
I've opened #1046 to add the positional fallback to match Java. Does that work
for you?
--
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]