fix:GrowingDataGetter get the wrong string data (#38015)

issue: https://github.com/milvus-io/milvus/issues/37994
2.4 pr: https://github.com/milvus-io/milvus/pull/37995

Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
pull/38416/head
cqy123456 2024-12-12 14:50:42 +08:00 committed by GitHub
parent a514f839b2
commit b14a0c4bf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,11 @@ class GrowingDataGetter : public DataGetter<T> {
T
Get(int64_t idx) const {
return growing_raw_data_->operator[](idx);
if constexpr (std::is_same_v<std::string, T>) {
return T(growing_raw_data_->view_element(idx));
} else {
return growing_raw_data_->operator[](idx);
}
}
};