enhance: [2.5]Only check element type with not null array (#40447)

master pr: #40446

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
cai.zhang 2025-03-07 12:49:08 +08:00 committed by GitHub
parent 54a2509220
commit 8d76d58d20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -592,12 +592,13 @@ InvertedIndexTantivy<std::string>::build_index_for_array(
auto n = data->get_num_rows();
auto array_column = static_cast<const Array*>(data->Data());
for (int64_t i = 0; i < n; i++) {
Assert(IsStringDataType(array_column[i].get_element_type()));
Assert(IsStringDataType(
static_cast<DataType>(schema_.element_type())));
if (schema_.nullable() && !data->is_valid(i)) {
folly::SharedMutex::WriteHolder lock(mutex_);
null_offset_.push_back(i);
} else {
Assert(IsStringDataType(array_column[i].get_element_type()));
Assert(IsStringDataType(
static_cast<DataType>(schema_.element_type())));
}
std::vector<std::string> output;
for (int64_t j = 0; j < array_column[i].length(); j++) {