ljyss9 commented on code in PR #483:
URL: https://github.com/apache/paimon-cpp/pull/483#discussion_r4548550019
##########
src/paimon/core/io/file_index_evaluator.cpp:
##########
@@ -81,18 +83,27 @@ Result<std::unique_ptr<FileIndexEvaluator>>
FileIndexEvaluator::Create(
const std::map<std::string, std::string>& options,
const std::shared_ptr<DataFilePathFactory>& path_factory,
const std::shared_ptr<DataFileMeta>& file_meta, const
std::shared_ptr<FileSystem>& file_system,
- const std::shared_ptr<MemoryPool>& pool) {
+ const std::shared_ptr<Cache>& cache, const std::shared_ptr<MemoryPool>&
pool) {
+ std::shared_ptr<InputStream> input_stream;
std::unique_ptr<FileIndexFormat::Reader> format_reader;
if (file_meta->row_count >= 0 && file_meta->row_count <=
RoaringBitmap32::MAX_VALUE) {
- PAIMON_ASSIGN_OR_RAISE(std::shared_ptr<InputStream> input_stream,
+ PAIMON_ASSIGN_OR_RAISE(input_stream,
ExtractIndexInputStream(path_factory,
file_meta, file_system));
if (input_stream) {
PAIMON_ASSIGN_OR_RAISE(format_reader,
FileIndexFormat::CreateReader(input_stream,
pool, options));
}
}
- return std::unique_ptr<FileIndexEvaluator>(
+ auto evaluator = std::unique_ptr<FileIndexEvaluator>(
new FileIndexEvaluator(data_schema, file_meta,
std::move(format_reader)));
+ if (cache && input_stream) {
+ auto uri = input_stream->GetUri();
+ if (uri.ok() && !uri.value().empty()) {
+ evaluator->cache_ = cache;
+ evaluator->uri_ = std::move(uri).value();
+ }
+ }
Review Comment:
ok
--
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]