Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression: Add vector functions #55021

Merged
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
98b15cf
Add Vector data type
EricZequan Jul 15, 2024
68e3546
Add Vector data type
EricZequan Jul 15, 2024
f01373a
Add Vector data type
EricZequan Jul 15, 2024
3420f9b
Add Vector data type
EricZequan Jul 15, 2024
9b22faf
Add Vector data type
EricZequan Jul 16, 2024
0037a86
Add Vector data type
EricZequan Jul 16, 2024
7227ca2
Add Vector data type(2)
EricZequan Jul 16, 2024
acfdf39
Add Vector data type(3)
EricZequan Jul 17, 2024
c57f4b1
Add Vector data type(4)
EricZequan Jul 17, 2024
becbe6a
Add Vector data type(4)
EricZequan Jul 17, 2024
74e8abe
Add Vector data type(5)
EricZequan Jul 17, 2024
eb1571a
Add Vector data type(6)
EricZequan Jul 17, 2024
cb09611
Add Vector data type(7)
EricZequan Jul 17, 2024
066ed32
Add Vector data type(8)
EricZequan Jul 18, 2024
4cce327
Add Vector data type(9)
EricZequan Jul 18, 2024
66ed138
Add Vector data type(10)
EricZequan Jul 18, 2024
0e9229d
vector data type(11)
EricZequan Jul 22, 2024
786ab30
Add Vector Data Type(12)
EricZequan Jul 22, 2024
3feccce
Add Vector Data Type(12)
EricZequan Jul 22, 2024
f4bfc0b
Merge branch 'pingcap:master' into vector-type
EricZequan Jul 22, 2024
e251f72
Add Vector Data Type(13)
EricZequan Jul 25, 2024
08a2db3
Merge remote-tracking branch 'origin' into vector-type
EricZequan Jul 25, 2024
62cd94b
fixed dimension vector
EricZequan Jul 29, 2024
2ac243b
fixed dimension vector
EricZequan Jul 29, 2024
02df1dd
remove some unneed line
EricZequan Jul 29, 2024
b780290
fix a bug when using 'update'
EricZequan Jul 30, 2024
2d6a2b0
fix test example fail
EricZequan Jul 30, 2024
9c16ebe
fix test example fail
EricZequan Jul 30, 2024
54b6e38
modify some code write style
EricZequan Jul 31, 2024
a53550f
fix a test-function run fail
EricZequan Jul 31, 2024
ed8ff17
fix a test-function run fail
EricZequan Jul 31, 2024
ab0a49b
change code writing
EricZequan Jul 31, 2024
7589def
modify pkg/parser/parser.y
EricZequan Jul 31, 2024
1a161d8
modify pkg/ddl/index.go
EricZequan Jul 31, 2024
f132098
modify pkg/ddl/index.go
EricZequan Jul 31, 2024
6803a28
Merge branch 'vector-type' into pr-872
EricZequan Jul 31, 2024
e139397
Merge branch 'pr-872' into pr-878
EricZequan Jul 31, 2024
3448a11
modify pkg/types/datum.go
EricZequan Aug 1, 2024
737b81f
Merge branch 'pr-872' into pr-878
EricZequan Aug 1, 2024
a85553c
Add vector function
EricZequan Aug 1, 2024
2b853cb
fix multiply function for vector
EricZequan Aug 1, 2024
f277c83
Merge branch 'feature/vector-search/vector-data-type' into pr-872
EricZequan Aug 2, 2024
157592d
removed the variable EnableVectorType
EricZequan Aug 2, 2024
2bebf25
fix TestVectorColumnInfo fail
EricZequan Aug 5, 2024
91190c6
fix TestVectorColumnInfo fail
EricZequan Aug 5, 2024
093d2a7
Merge branch 'pr-872' into pr-878
EricZequan Aug 5, 2024
c453c02
remove the 'vector-type-enable' in test
EricZequan Aug 5, 2024
5e30460
change the limitation of vector-dimension into 16383
EricZequan Aug 5, 2024
70cdff3
modify vector dimention test example
EricZequan Aug 5, 2024
03c24e6
Merge branch 'pr-872' into pr-878
EricZequan Aug 6, 2024
6598227
Merge branch 'feature/vector-search/vector-data-type' into pr-878
EricZequan Aug 6, 2024
b32e75e
change 'builtinLeastVectorFloat32Sig' location
EricZequan Aug 6, 2024
281bfc7
Merge branch 'pr-878' of https://github.com/EricZequan/tidb into pr-878
EricZequan Aug 6, 2024
026043f
change function 'checkVectorAggPushDown' to return bool
EricZequan Aug 9, 2024
4107e95
fix
EricZequan Aug 9, 2024
1293668
fix
EricZequan Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/expression/aggregation/aggregation.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func CheckAggPushDown(ctx expression.EvalContext, aggFunc *AggFuncDesc, storeTyp
if aggFunc.Name == ast.AggFuncApproxPercentile {
return false
}
if checkVectorAggPushDown(ctx, aggFunc) != nil {
if !checkVectorAggPushDown(ctx, aggFunc) {
return false
}
ret := true
Expand All @@ -260,16 +260,16 @@ func CheckAggPushDown(ctx expression.EvalContext, aggFunc *AggFuncDesc, storeTyp
// - The aggregate function is not calculated over a Vector column (returns nil)
EricZequan marked this conversation as resolved.
Show resolved Hide resolved
// - The aggregate function is calculated over a Vector column and the function is supported (returns nil)
// - The aggregate function is calculated over a Vector column and the function is not supported (returns error)
func checkVectorAggPushDown(ctx expression.EvalContext, aggFunc *AggFuncDesc) error {
func checkVectorAggPushDown(ctx expression.EvalContext, aggFunc *AggFuncDesc) bool {
switch aggFunc.Name {
case ast.AggFuncCount, ast.AggFuncMin, ast.AggFuncMax, ast.AggFuncFirstRow:
return nil
return true
default:
if aggFunc.Args[0].GetType(ctx).GetType() == mysql.TypeTiDBVectorFloat32 {
return errors.Errorf("Aggregate function %s is not supported for VectorFloat32", aggFunc.Name)
return false
}
}
return nil
return true
}

// CheckAggPushFlash checks whether an agg function can be pushed to flash storage.
Expand Down