fix: Match int8_t and int16_t in Array::get_data (#35579)

Related to #35578

Previously int16/int8 bitmap index may read int32 array as int16, which
may cause build index with half of the data(if array is full) and half
zeros. This causes BITMAP index lost information.

This PR matches int8_t & int16_t while `get_data` when building index.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/35359/head
congqixia 2024-08-20 16:10:56 +08:00 committed by GitHub
parent 249dc4d9eb
commit 3491608256
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#pragma once
#include <type_traits>
#include <utility>
#include <vector>
@ -246,6 +247,7 @@ class Array {
return T(data_ + offsets_[index], element_length);
}
if constexpr (std::is_same_v<T, int> || std::is_same_v<T, int64_t> ||
std::is_same_v<T, int8_t> || std::is_same_v<T, int16_t> ||
std::is_same_v<T, float> || std::is_same_v<T, double>) {
switch (element_type_) {
case DataType::INT8: