gripleaf commented on code in PR #411:
URL: https://github.com/apache/paimon-cpp/pull/411#discussion_r4236953646


##########
src/paimon/core/manifest/manifest_file.cpp:
##########
@@ -133,6 +134,66 @@ Status ManifestFile::ReadBucketEntries(const std::string& 
file_name, int32_t buc
         });
 }
 
+Status ManifestFile::ReadRowRangeEntries(
+    const std::string& file_name, const RowRangeIndex& row_ranges,
+    const std::function<Result<bool>(const ManifestEntry&)>& filter,
+    std::optional<int64_t> file_size, std::vector<ManifestEntry>* entries) 
const {
+    return ReadArrowBatches(
+        file_name, file_size,
+        [this, &row_ranges, &filter,
+         entries](const std::shared_ptr<arrow::StructArray>& batch) -> Status {
+            // ManifestMetaReader has aligned both the entry and its nested 
file schema. Probe
+            // the two range columns without allocating DataFileMeta, stats or 
binary keys.
+            constexpr int32_t kFileFieldIndex = 5;
+            constexpr int32_t kRowCountFieldIndex = 2;
+            constexpr int32_t kFirstRowIdFieldIndex = 18;

Review Comment:
   Agreed. Moved the field-position constants into ManifestEntry and 
DataFileMeta, and reused them in serialization, deserialization, and row-range 
pruning. Access to the serialized manifest entry explicitly accounts for the 
leading _VERSION field. The schema evolution and version validation tests also 
pass with these changes.



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

Reply via email to