mirror of https://github.com/milvus-io/milvus.git
Define array type and ANNS syntax (#23395)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>pull/23463/head
parent
43ac451d07
commit
a455595c9b
|
@ -233,6 +233,11 @@ WRITE: 'WRITE';
|
|||
XOR: 'XOR';
|
||||
ZEROFILL: 'ZEROFILL';
|
||||
|
||||
// ANNS
|
||||
ANNS: 'ANNS';
|
||||
ANNS_OP: '->';
|
||||
ANNS_PARAMS: 'PARAMS';
|
||||
|
||||
// DATA TYPE Keywords
|
||||
|
||||
TINYINT: 'TINYINT';
|
||||
|
@ -1249,6 +1254,8 @@ SINGLE_QUOTE_SYMB: '\'';
|
|||
DOUBLE_QUOTE_SYMB: '"';
|
||||
REVERSE_QUOTE_SYMB: '`';
|
||||
COLON_SYMB: ':';
|
||||
LR_BRACKETS: '[';
|
||||
RR_BRACKETS: ']';
|
||||
|
||||
fragment QUOTE_SYMB
|
||||
: SINGLE_QUOTE_SYMB | DOUBLE_QUOTE_SYMB | REVERSE_QUOTE_SYMB
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -1070,7 +1070,7 @@ tableSource
|
|||
|
||||
querySpecification
|
||||
: SELECT selectSpec* selectElements
|
||||
fromClause? limitClause?
|
||||
fromClause? annsClause? limitClause?
|
||||
;
|
||||
|
||||
// querySpecificationNointo
|
||||
|
@ -1182,6 +1182,34 @@ fromClause
|
|||
(WHERE whereExpr=expression)?
|
||||
;
|
||||
|
||||
annsClause
|
||||
: ANNS BY fullColumnName ANNS_OP annsVectors annsParamsClause?
|
||||
;
|
||||
|
||||
annsVectors
|
||||
: '(' (annsVector (',' annsVector)* )? ')'
|
||||
;
|
||||
|
||||
annsVector
|
||||
: (floatArray | BIT_STRING)
|
||||
;
|
||||
|
||||
annsParamsClause
|
||||
: ANNS_PARAMS '=' kvPairs
|
||||
;
|
||||
|
||||
kvPairs
|
||||
: '(' (kvPair (',' kvPair)*)? ')'
|
||||
;
|
||||
|
||||
kvPair
|
||||
: ID '=' value
|
||||
;
|
||||
|
||||
value
|
||||
: (ID|constant)
|
||||
;
|
||||
|
||||
// groupByClause
|
||||
// : GROUP BY
|
||||
// groupByItem (',' groupByItem)*
|
||||
|
@ -2212,7 +2240,7 @@ constant
|
|||
| '-' decimalLiteral
|
||||
| hexadecimalLiteral | booleanLiteral
|
||||
| REAL_LITERAL
|
||||
// | BIT_STRING
|
||||
| BIT_STRING
|
||||
// | NOT? nullLiteral=(NULL_LITERAL | NULL_SPEC_LITERAL)
|
||||
;
|
||||
|
||||
|
@ -2640,6 +2668,15 @@ expressionAtom
|
|||
| unaryOperator expressionAtom #unaryExpressionAtom
|
||||
// | BINARY expressionAtom #binaryExpressionAtom
|
||||
| '(' expression (',' expression)* ')' #nestedExpressionAtom
|
||||
| array #arrayExpressionAtom
|
||||
;
|
||||
|
||||
array
|
||||
: '[' ( expression ( ',' expression )* )? ']'
|
||||
;
|
||||
|
||||
floatArray
|
||||
: '[' ( decimalLiteral ( ',' decimalLiteral )* )? ']'
|
||||
;
|
||||
|
||||
unaryOperator
|
||||
|
@ -2856,4 +2893,4 @@ logicalOperator
|
|||
// | JSON_VALID | JSON_TABLE | JSON_SCHEMA_VALID | JSON_SCHEMA_VALIDATION_REPORT
|
||||
// | JSON_PRETTY | JSON_STORAGE_FREE | JSON_STORAGE_SIZE | JSON_ARRAYAGG
|
||||
// | JSON_OBJECTAGG
|
||||
// ;
|
||||
// ;
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -67,6 +67,34 @@ func (v *BaseMySqlParserVisitor) VisitFromClause(ctx *FromClauseContext) interfa
|
|||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitAnnsClause(ctx *AnnsClauseContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitAnnsVectors(ctx *AnnsVectorsContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitAnnsVector(ctx *AnnsVectorContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitAnnsParamsClause(ctx *AnnsParamsClauseContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitKvPairs(ctx *KvPairsContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitKvPair(ctx *KvPairContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitValue(ctx *ValueContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitLimitClause(ctx *LimitClauseContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
@ -179,6 +207,18 @@ func (v *BaseMySqlParserVisitor) VisitNestedExpressionAtom(ctx *NestedExpression
|
|||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitArrayExpressionAtom(ctx *ArrayExpressionAtomContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitArray(ctx *ArrayContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitFloatArray(ctx *FloatArrayContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseMySqlParserVisitor) VisitUnaryOperator(ctx *UnaryOperatorContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
|
|
@ -52,6 +52,27 @@ type MySqlParserVisitor interface {
|
|||
// Visit a parse tree produced by MySqlParser#fromClause.
|
||||
VisitFromClause(ctx *FromClauseContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#annsClause.
|
||||
VisitAnnsClause(ctx *AnnsClauseContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#annsVectors.
|
||||
VisitAnnsVectors(ctx *AnnsVectorsContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#annsVector.
|
||||
VisitAnnsVector(ctx *AnnsVectorContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#annsParamsClause.
|
||||
VisitAnnsParamsClause(ctx *AnnsParamsClauseContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#kvPairs.
|
||||
VisitKvPairs(ctx *KvPairsContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#kvPair.
|
||||
VisitKvPair(ctx *KvPairContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#value.
|
||||
VisitValue(ctx *ValueContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#limitClause.
|
||||
VisitLimitClause(ctx *LimitClauseContext) interface{}
|
||||
|
||||
|
@ -136,6 +157,15 @@ type MySqlParserVisitor interface {
|
|||
// Visit a parse tree produced by MySqlParser#nestedExpressionAtom.
|
||||
VisitNestedExpressionAtom(ctx *NestedExpressionAtomContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#arrayExpressionAtom.
|
||||
VisitArrayExpressionAtom(ctx *ArrayExpressionAtomContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#array.
|
||||
VisitArray(ctx *ArrayContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#floatArray.
|
||||
VisitFloatArray(ctx *FloatArrayContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by MySqlParser#unaryOperator.
|
||||
VisitUnaryOperator(ctx *UnaryOperatorContext) interface{}
|
||||
|
||||
|
|
Loading…
Reference in New Issue