fixed an edge case that index column has no data

This commit is contained in:
Larry Luo 2022-08-29 19:58:42 -07:00
parent da93210cc6
commit 64f807f31a
2 changed files with 2 additions and 2 deletions

View File

@ -403,7 +403,7 @@ GinIndexStorePtr GinIndexStoreFactory::get(const String& name, DataPartStoragePt
GinIndexStorePtr store = std::make_shared<GinIndexStore>(name);
store->SetStorage(storage_);
if (!store->exists())
throw Exception("Index '" + name + "' does not exist", ErrorCodes::LOGICAL_ERROR);
return nullptr; //gin index was not generated for the part due to no data or the length of column data is less than ngramsize
GinIndexStoreReader reader(store);
reader.readSegments();

View File

@ -1739,7 +1739,7 @@ MarkRanges MergeTreeDataSelectExecutor::filterMarksUsingIndex(
if (!gin_filter_condition)
result = condition->mayBeTrueOnGranule(granule);
else
result = gin_filter_condition->mayBeTrueOnGranuleInPart(granule, cache_in_store);
result = cache_in_store.store ? gin_filter_condition->mayBeTrueOnGranuleInPart(granule, cache_in_store) : true;
if (!result)
{