kamcheungting-db commented on code in PR #714:
URL: https://github.com/apache/iceberg-cpp/pull/714#discussion_r3632869339


##########
src/iceberg/parquet/parquet_reader.cc:
##########
@@ -214,6 +254,17 @@ class ParquetReader::Impl {
     ICEBERG_RETURN_UNEXPECTED(ToArrowSchema(*read_schema_, &arrow_schema));
     ICEBERG_ARROW_ASSIGN_OR_RETURN(context_->output_arrow_schema_,
                                    ::arrow::ImportSchema(&arrow_schema));
+    if (use_large_list_) {
+      // Align the output schema with the large_list arrays produced by the
+      // Parquet reader when kArrowUseLargeList is enabled.
+      ::arrow::FieldVector fields;
+      fields.reserve(context_->output_arrow_schema_->fields().size());
+      for (const auto& field : context_->output_arrow_schema_->fields()) {
+        fields.push_back(UseLargeListField(field));
+      }

Review Comment:
   this is duplicated logic.
   let's add a method.
   ```
   ::arrow::FieldVector UseLargeListFields(const ::arrow::FieldVector& fields) {
     ::arrow::FieldVector rewritten;
     rewritten.reserve(fields.size());
     for (const auto& field : fields) {
       rewritten.push_back(UseLargeListField(field));
     }
     return rewritten;
   }
   ```



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