[optimize](invert index) avoid redundant checks for exist. (#30191)

This commit is contained in:
zzzxl
2024-01-29 14:12:43 +08:00
committed by yiguolei
parent 779a9a1fbb
commit 11f1b129c0

View File

@ -285,12 +285,6 @@ Status FullTextIndexReader::query(OlapReaderStatistics* stats, RuntimeState* run
}
}
// check index file existence
if (!indexExists(index_file_path)) {
return Status::Error<ErrorCode::INVERTED_INDEX_FILE_NOT_FOUND>(
"inverted index path: {} not exist.", index_file_path.string());
}
std::unique_ptr<lucene::search::Query> query;
std::wstring field_ws = std::wstring(column_name.begin(), column_name.end());
@ -575,12 +569,6 @@ Status StringTypeInvertedIndexReader::query(OlapReaderStatistics* stats,
stats->inverted_index_query_cache_miss++;
}
// check index file existence
if (!indexExists(index_file_path)) {
return Status::Error<ErrorCode::INVERTED_INDEX_FILE_NOT_FOUND>(
"inverted index path: {} not exist.", index_file_path.string());
}
switch (query_type) {
case InvertedIndexQueryType::MATCH_ANY_QUERY:
case InvertedIndexQueryType::MATCH_ALL_QUERY: