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


##########
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:
   I don't think we should add positional fallback. IIRC, that fallback was 
added for legacy use case.



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