shangxinli commented on code in PR #1044:
URL: https://github.com/apache/iceberg-cpp/pull/1044#discussion_r4328470465


##########
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:
   Java does not error here - ReadConf.java:85-88 falls back to addFallbackIds 
and assigns positional ids, so this file still reads there. Not a regression, 
but is closing that gap out of scope?



-- 
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]

Reply via email to