manuzhang commented on code in PR #822:
URL: https://github.com/apache/iceberg-cpp/pull/822#discussion_r3568093459


##########
src/iceberg/parquet/parquet_data_util.cc:
##########
@@ -70,6 +70,53 @@ Result<std::shared_ptr<::arrow::Array>> 
ProjectPrimitiveArray(
   return cast_result.make_array();
 }
 
+Result<std::shared_ptr<::arrow::Array>> MakeInheritedRowLineageArray(
+    int32_t field_id, int64_t num_rows,
+    const arrow::MetadataColumnContext& metadata_context, ::arrow::MemoryPool* 
pool) {
+  if (field_id == MetadataColumns::kRowIdColumnId) {
+    return arrow::MakeRowIdArray(metadata_context.first_row_id,
+                                 metadata_context.next_file_pos, num_rows, 
pool);
+  }
+  if (field_id == MetadataColumns::kLastUpdatedSequenceNumberColumnId) {
+    return arrow::MakeLastUpdatedSequenceNumberArray(
+        metadata_context.first_row_id, metadata_context.data_sequence_number, 
num_rows,
+        pool);
+  }
+  return NotSupported("Unsupported row lineage field id: {}", field_id);
+}
+
+Result<std::shared_ptr<::arrow::Array>> ProjectRowLineageArray(
+    const std::shared_ptr<::arrow::Array>& physical_array, int32_t field_id,
+    const arrow::MetadataColumnContext& metadata_context, ::arrow::MemoryPool* 
pool) {
+  if (!arrow::HasRowLineageValue(field_id, metadata_context)) {

Review Comment:
   It looks physical array is not examined and its non-null value might not be 
preserved with `first_row_id` present but `data_sequence_number` absent. Both 
Avro generic decoding and direct decoding have similar issues.



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