Skip to content

Commit

Permalink
Merge branch 'pr-872' into pr-878
Browse files Browse the repository at this point in the history
Signed-off-by: “EricZequan” <[email protected]>
  • Loading branch information
EricZequan committed Aug 6, 2024
2 parents c453c02 + 70cdff3 commit 03c24e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/expression/integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ func TestVectorColumnInfo(t *testing.T) {
"vector<float> vector<float>(3)",
))

// Vector dimension MUST be equal or less than 16000.
// Vector dimension MUST be equal or less than 16383.
tk.MustExec("drop table if exists t;")
tk.MustGetErrMsg("create table t(embedding VECTOR<FLOAT>(16001))", "vector cannot have more than 16000 dimensions")
tk.MustGetErrMsg("create table t(embedding VECTOR<FLOAT>(16384))", "vector cannot have more than 16383 dimensions")
}

func TestFixedVector(t *testing.T) {
Expand Down Expand Up @@ -137,8 +137,8 @@ func TestFixedVector(t *testing.T) {
tk.MustExec("alter table t modify column embedding VECTOR")
tk.MustExec("insert into t values ('[1,2,3,4]')")

// Vector dimension MUST be equal or less than 16000.
tk.MustGetErrMsg("alter table t modify column embedding VECTOR(16001)", "vector cannot have more than 16000 dimensions")
// Vector dimension MUST be equal or less than 16383.
tk.MustGetErrMsg("alter table t modify column embedding VECTOR(16384)", "vector cannot have more than 16383 dimensions")
}

func TestVector(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func InitVectorFloat32(dims int) VectorFloat32 {
// CheckVectorDimValid checks if the vector's dimension is valid.
func CheckVectorDimValid(dim int) error {
const (
maxVectorDimension = 16000
maxVectorDimension = 16383
)
if dim < 0 {
return errors.Errorf("dimensions for type vector must be at least 0")
Expand Down

0 comments on commit 03c24e6

Please sign in to comment.