wangyong9999 commented on code in PR #194:
URL: https://github.com/apache/paimon-cpp/pull/194#discussion_r3800356169
##########
include/paimon/global_index/global_indexer.h:
##########
@@ -70,6 +72,27 @@ class PAIMON_EXPORT GlobalIndexer {
::ArrowSchema* arrow_schema, const
std::shared_ptr<GlobalIndexFileReader>& file_reader,
const std::vector<GlobalIndexIOMeta>& files,
const std::shared_ptr<MemoryPool>& pool) const = 0;
+
+ /// Creates a reader using an executor supplied by the scan layer.
+ ///
+ /// Index implementations which do not perform asynchronous work may
ignore the executor and
+ /// use the compatibility overload above.
+ ///
+ /// @param arrow_schema Schema of the indexed data; used to interpret
predicate literals.
+ /// @param file_reader I/O handler for reading index artifacts from
storage.
+ /// @param files List of index file metadata entries produced
during writing.
+ /// @param pool Memory pool for temporary allocations; if
nullptr, uses default.
+ /// @param executor Executor shared by readers created for the same
scan; nullptr means
+ /// that the reader should evaluate sequentially.
+ /// @return A `Result` containing a shared pointer to the created
`GlobalIndexReader`,
+ /// or an error if the index cannot be loaded or is incompatible,
etc.
+ virtual Result<std::shared_ptr<GlobalIndexReader>> CreateReader(
+ ::ArrowSchema* arrow_schema, const
std::shared_ptr<GlobalIndexFileReader>& file_reader,
+ const std::vector<GlobalIndexIOMeta>& files, const
std::shared_ptr<MemoryPool>& pool,
+ const std::shared_ptr<Executor>& executor) const {
+ static_cast<void>(executor);
+ return CreateReader(arrow_schema, file_reader, files, pool);
+ }
Review Comment:
Good point. PK groups contain one payload, so the executor overload was
unnecessary. I removed it and kept the existing four-argument API; BTree now
creates its private executor only for multiple payloads, preserving legacy
parallel evaluation while single-payload PK reads stay inline.
--
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]