mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix:fix retrieve raw data from bitmap array index (#34848)
#34795 Signed-off-by: luzhang <luzhang@zilliz.com> Co-authored-by: luzhang <luzhang@zilliz.com>
This commit is contained in:
parent
e93687cdd3
commit
804ec24c02
@ -32,7 +32,8 @@ PhyUnaryRangeFilterExpr::CanUseIndexForArray() {
|
||||
const Index& index =
|
||||
segment_->chunk_scalar_index<IndexInnerType>(field_id_, i);
|
||||
|
||||
if (index.GetIndexType() == milvus::index::ScalarIndexType::HYBRID) {
|
||||
if (index.GetIndexType() == milvus::index::ScalarIndexType::HYBRID ||
|
||||
index.GetIndexType() == milvus::index::ScalarIndexType::BITMAP) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,6 +117,9 @@ class BitmapIndex : public ScalarIndex<T> {
|
||||
|
||||
const bool
|
||||
HasRawData() const override {
|
||||
if (schema_.data_type() == proto::schema::DataType::Array) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -44,6 +44,8 @@ const (
|
||||
|
||||
// Sparse Index Param
|
||||
SparseDropRatioBuild = "drop_ratio_build"
|
||||
|
||||
MaxBitmapCardinalityLimit = 1000
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@ -33,4 +33,5 @@ func Test_HybridIndexChecker(t *testing.T) {
|
||||
assert.Error(t, c.CheckValidDataType(&schemapb.FieldSchema{DataType: schemapb.DataType_Array, ElementType: schemapb.DataType_Double}))
|
||||
assert.Error(t, c.CheckTrain(map[string]string{}))
|
||||
assert.Error(t, c.CheckTrain(map[string]string{"bitmap_cardinality_limit": "0"}))
|
||||
assert.Error(t, c.CheckTrain(map[string]string{"bitmap_cardinality_limit": "2000"}))
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package indexparamcheck
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
||||
"github.com/milvus-io/milvus/pkg/common"
|
||||
@ -14,8 +13,9 @@ type HYBRIDChecker struct {
|
||||
}
|
||||
|
||||
func (c *HYBRIDChecker) CheckTrain(params map[string]string) error {
|
||||
if !CheckIntByRange(params, common.BitmapCardinalityLimitKey, 1, math.MaxInt) {
|
||||
return fmt.Errorf("failed to check bitmap cardinality limit, should be larger than 0 and smaller than math.MaxInt")
|
||||
if !CheckIntByRange(params, common.BitmapCardinalityLimitKey, 1, MaxBitmapCardinalityLimit) {
|
||||
return fmt.Errorf("failed to check bitmap cardinality limit, should be larger than 0 and smaller than %d",
|
||||
MaxBitmapCardinalityLimit)
|
||||
}
|
||||
return c.scalarIndexChecker.CheckTrain(params)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user