fix:reset default auto index type for scalar (#37086)

#32900

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
pull/37169/head
zhagnlu 2024-10-27 16:19:29 +08:00 committed by GitHub
parent a2f0092e39
commit eeb67a3845
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 12 deletions

View File

@ -21,7 +21,6 @@ import (
"encoding/json"
"os"
"sort"
"strconv"
"testing"
"github.com/cockroachdb/errors"
@ -665,8 +664,7 @@ func Test_parseIndexParams(t *testing.T) {
assert.NoError(t, err)
sortKeyValuePairs(cit.newIndexParams)
assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid},
{Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapCardinalityLimit)},
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexINVERTED},
})
})
@ -709,8 +707,7 @@ func Test_parseIndexParams(t *testing.T) {
assert.NoError(t, err)
sortKeyValuePairs(cit.newIndexParams)
assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid},
{Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapCardinalityLimit)},
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexINVERTED},
})
})
@ -938,8 +935,7 @@ func Test_parseIndexParams(t *testing.T) {
assert.NoError(t, err)
sortKeyValuePairs(cit.newIndexParams)
assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid},
{Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapCardinalityLimit)},
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexINVERTED},
})
})
@ -968,8 +964,7 @@ func Test_parseIndexParams(t *testing.T) {
assert.NoError(t, err)
sortKeyValuePairs(cit.newIndexParams)
assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid},
{Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapCardinalityLimit)},
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexINVERTED},
})
})
@ -998,8 +993,7 @@ func Test_parseIndexParams(t *testing.T) {
assert.NoError(t, err)
sortKeyValuePairs(cit.newIndexParams)
assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid},
{Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapCardinalityLimit)},
{Key: common.IndexTypeKey, Value: indexparamcheck.IndexINVERTED},
})
})

View File

@ -170,7 +170,7 @@ func (p *autoIndexConfig) init(base *BaseTable) {
p.ScalarAutoIndexParams = ParamItem{
Key: "scalarAutoIndex.params.build",
Version: "2.4.0",
DefaultValue: `{"int": "HYBRID","varchar": "HYBRID","bool": "BITMAP", "float": "INVERTED"}`,
DefaultValue: `{"int": "INVERTED", "float": "INVERTED", "varchar": "INVERTED", "bool": "BITMAP"}`,
}
p.ScalarAutoIndexParams.Init(base.mgr)