lxy-9602 commented on code in PR #558:
URL: https://github.com/apache/paimon-cpp/pull/558#discussion_r4656670709


##########
src/paimon/core/operation/precise_file_index_read.h:
##########
@@ -105,12 +119,14 @@ class PreciseFileIndexRead {
     const BinaryRow& partition_;
     std::shared_ptr<DataFileMeta> file_;
     std::shared_ptr<arrow::Schema> read_schema_;
-    std::shared_ptr<Predicate> predicate_;
     const FieldMappingBuilder* field_mapping_builder_;
     std::shared_ptr<DataFilePathFactory> path_factory_;
     std::map<std::string, std::string> extra_format_options_;
     std::unique_ptr<FileIndexEvaluator> indexes_;
-    std::map<std::shared_ptr<LeafPredicate>, std::shared_ptr<LeafPredicate>> 
mapped_leaves_;
+    // Read field name -> field definition, including the ID used to map 
predicates to file fields.
+    std::map<std::string, DataField> read_by_name_;
+    // Field ID -> (zero-based position in the file schema, file field 
definition).
+    std::map<int32_t, std::pair<int32_t, DataField>> data_by_id_;
     std::shared_ptr<VectorSearch> vector_search_;

Review Comment:
   Since `FileIndexRead` caches file index reader and then precisely fetches 
the row-number information related to the `predicate`, I added a 
`ReadRowPositions` interface for `PreciseFileIndexRead`. However, because 
`FileIndexRead` can be called with dynamic predicates, `predicate_` and 
`mapped_leaves_` are now passed in from outside rather than being fixed when 
read is created. I haven’t modified the `vector_search_` / `full_text_search_` 
logic yet, but in fact this part should also be passed dynamically via 
`CreateReader` instead of being fixed when constructing `FileIndexRead`. 
Moreover, creating the reader and performing precise predicate matching could 
potentially be split into two classes with clearer single responsibilities. A 
refactor may be needed later. @lszskye 



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