mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 19:39:21 +08:00
feat: The expression supports filling elements through templates (#37033)
issue: #36672 The expression supports filling elements through templates, which helps to reduce the overhead of parsing the elements. --------- Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
4d98833bc3
commit
2ef6cbbf59
2
go.mod
2
go.mod
@ -23,7 +23,7 @@ require (
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
||||
github.com/klauspost/compress v1.17.9
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
|
||||
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240930043709-0c23514e4c34
|
||||
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20241025031121-4d5c88b00cf7
|
||||
github.com/minio/minio-go/v7 v7.0.73
|
||||
github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81
|
||||
github.com/prometheus/client_golang v1.14.0
|
||||
|
2
go.sum
2
go.sum
@ -629,6 +629,8 @@ github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZz
|
||||
github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4=
|
||||
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240930043709-0c23514e4c34 h1:Fwxpg98128gfWRbQ1A3PMP9o2IfYZk7RSEy8rcoCWDA=
|
||||
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240930043709-0c23514e4c34/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs=
|
||||
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20241025031121-4d5c88b00cf7 h1:HwAitQk+V59QdYUwwVVYHTujd4QZrebg2Cc2hmcjhAg=
|
||||
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20241025031121-4d5c88b00cf7/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs=
|
||||
github.com/milvus-io/pulsar-client-go v0.12.1 h1:O2JZp1tsYiO7C0MQ4hrUY/aJXnn2Gry6hpm7UodghmE=
|
||||
github.com/milvus-io/pulsar-client-go v0.12.1/go.mod h1:dkutuH4oS2pXiGm+Ti7fQZ4MRjrMPZ8IJeEGAWMeckk=
|
||||
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs=
|
||||
|
@ -5,8 +5,9 @@ expr:
|
||||
| FloatingConstant # Floating
|
||||
| BooleanConstant # Boolean
|
||||
| StringLiteral # String
|
||||
| Identifier # Identifier
|
||||
| (Identifier|Meta) # Identifier
|
||||
| JSONIdentifier # JSONIdentifier
|
||||
| LBRACE Identifier RBRACE # TemplateVariable
|
||||
| '(' expr ')' # Parens
|
||||
| '[' expr (',' expr)* ','? ']' # Array
|
||||
| EmptyArray # EmptyArray
|
||||
@ -19,7 +20,6 @@ expr:
|
||||
| expr op = (ADD | SUB) expr # AddSub
|
||||
| expr op = (SHL | SHR) expr # Shift
|
||||
| expr op = NOT? IN expr # Term
|
||||
// | EmptyTerm # EmptyTerm
|
||||
| (JSONContains | ArrayContains)'('expr',' expr')' # JSONContains
|
||||
| (JSONContainsAll | ArrayContainsAll)'('expr',' expr')' # JSONContainsAll
|
||||
| (JSONContainsAny | ArrayContainsAny)'('expr',' expr')' # JSONContainsAny
|
||||
@ -45,6 +45,8 @@ expr:
|
||||
// INT64: 'int64';
|
||||
// FLOAT: 'float';
|
||||
// DOUBLE: 'double';
|
||||
LBRACE: '{';
|
||||
RBRACE: '}';
|
||||
|
||||
LT: '<';
|
||||
LE: '<=';
|
||||
@ -99,10 +101,11 @@ FloatingConstant:
|
||||
DecimalFloatingConstant
|
||||
| HexadecimalFloatingConstant;
|
||||
|
||||
Identifier: Nondigit (Nondigit | Digit)* | '$meta';
|
||||
Identifier: Nondigit (Nondigit | Digit)*;
|
||||
Meta: '$meta';
|
||||
|
||||
StringLiteral: EncodingPrefix? ('"' DoubleSCharSequence? '"' | '\'' SingleSCharSequence? '\'');
|
||||
JSONIdentifier: Identifier('[' (StringLiteral | DecimalConstant) ']')+;
|
||||
JSONIdentifier: (Identifier | Meta)('[' (StringLiteral | DecimalConstant) ']')+;
|
||||
|
||||
fragment EncodingPrefix: 'u8' | 'u' | 'U' | 'L';
|
||||
|
||||
|
@ -26,9 +26,9 @@ func TestCheckIdentical(t *testing.T) {
|
||||
exprStr1 := exprStr1Arr[i]
|
||||
exprStr2 := exprStr2Arr[i]
|
||||
|
||||
expr1, err := ParseExpr(helper, exprStr1)
|
||||
expr1, err := ParseExpr(helper, exprStr1, nil)
|
||||
assert.NoError(t, err)
|
||||
expr2, err := ParseExpr(helper, exprStr2)
|
||||
expr2, err := ParseExpr(helper, exprStr2, nil)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.True(t, CheckPredicatesIdentical(expr1, expr1))
|
||||
|
@ -0,0 +1,73 @@
|
||||
package planparserv2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
||||
"github.com/milvus-io/milvus/internal/proto/planpb"
|
||||
)
|
||||
|
||||
func ConvertToGenericValue(templateName string, templateValue *schemapb.TemplateValue) (*planpb.GenericValue, error) {
|
||||
if templateValue == nil {
|
||||
return nil, fmt.Errorf("expression template variable value is nil, template name: {%s}", templateName)
|
||||
}
|
||||
switch templateValue.GetType() {
|
||||
case schemapb.DataType_Bool:
|
||||
return &planpb.GenericValue{
|
||||
Val: &planpb.GenericValue_BoolVal{
|
||||
BoolVal: templateValue.GetBoolVal(),
|
||||
},
|
||||
}, nil
|
||||
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64:
|
||||
return &planpb.GenericValue{
|
||||
Val: &planpb.GenericValue_Int64Val{
|
||||
Int64Val: templateValue.GetInt64Val(),
|
||||
},
|
||||
}, nil
|
||||
case schemapb.DataType_Float, schemapb.DataType_Double:
|
||||
return &planpb.GenericValue{
|
||||
Val: &planpb.GenericValue_FloatVal{
|
||||
FloatVal: templateValue.GetFloatVal(),
|
||||
},
|
||||
}, nil
|
||||
case schemapb.DataType_String, schemapb.DataType_VarChar:
|
||||
return &planpb.GenericValue{
|
||||
Val: &planpb.GenericValue_StringVal{
|
||||
StringVal: templateValue.GetStringVal(),
|
||||
},
|
||||
}, nil
|
||||
case schemapb.DataType_Array:
|
||||
elements := templateValue.GetArrayVal().GetArray()
|
||||
arrayValues := make([]*planpb.GenericValue, len(elements))
|
||||
for i, element := range elements {
|
||||
arrayElement, err := ConvertToGenericValue(templateName, element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
arrayValues[i] = arrayElement
|
||||
}
|
||||
return &planpb.GenericValue{
|
||||
Val: &planpb.GenericValue_ArrayVal{
|
||||
ArrayVal: &planpb.Array{
|
||||
Array: arrayValues,
|
||||
SameType: templateValue.GetArrayVal().GetSameType(),
|
||||
ElementType: templateValue.GetArrayVal().GetElementType(),
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("expression elements can only be scalars")
|
||||
}
|
||||
}
|
||||
|
||||
func UnmarshalExpressionValues(input map[string]*schemapb.TemplateValue) (map[string]*planpb.GenericValue, error) {
|
||||
result := make(map[string]*planpb.GenericValue, len(input))
|
||||
for name, value := range input {
|
||||
rv, err := ConvertToGenericValue(name, value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result[name] = rv
|
||||
}
|
||||
return result, nil
|
||||
}
|
@ -0,0 +1,286 @@
|
||||
package planparserv2
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
||||
"github.com/milvus-io/milvus/internal/proto/planpb"
|
||||
)
|
||||
|
||||
type convertTestcase struct {
|
||||
input map[string]*schemapb.TemplateValue
|
||||
expect map[string]*planpb.GenericValue
|
||||
}
|
||||
|
||||
func Test_ConvertToGenericValue(t *testing.T) {
|
||||
tests := []convertTestcase{
|
||||
{
|
||||
input: map[string]*schemapb.TemplateValue{
|
||||
"bool": {
|
||||
Type: schemapb.DataType_Bool,
|
||||
Val: &schemapb.TemplateValue_BoolVal{
|
||||
BoolVal: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
expect: map[string]*planpb.GenericValue{
|
||||
"bool": {
|
||||
Val: &planpb.GenericValue_BoolVal{
|
||||
BoolVal: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: map[string]*schemapb.TemplateValue{
|
||||
"int": {
|
||||
Type: schemapb.DataType_Int64,
|
||||
Val: &schemapb.TemplateValue_Int64Val{
|
||||
Int64Val: 999,
|
||||
},
|
||||
},
|
||||
},
|
||||
expect: map[string]*planpb.GenericValue{
|
||||
"int": {
|
||||
Val: &planpb.GenericValue_Int64Val{
|
||||
Int64Val: 999,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: map[string]*schemapb.TemplateValue{
|
||||
"float": {
|
||||
Type: schemapb.DataType_Float,
|
||||
Val: &schemapb.TemplateValue_FloatVal{
|
||||
FloatVal: 55.55,
|
||||
},
|
||||
},
|
||||
},
|
||||
expect: map[string]*planpb.GenericValue{
|
||||
"float": {
|
||||
Val: &planpb.GenericValue_FloatVal{
|
||||
FloatVal: 55.55,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: map[string]*schemapb.TemplateValue{
|
||||
"string": {
|
||||
Type: schemapb.DataType_VarChar,
|
||||
Val: &schemapb.TemplateValue_StringVal{
|
||||
StringVal: "abc",
|
||||
},
|
||||
},
|
||||
},
|
||||
expect: map[string]*planpb.GenericValue{
|
||||
"string": {
|
||||
Val: &planpb.GenericValue_StringVal{
|
||||
StringVal: "abc",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: map[string]*schemapb.TemplateValue{
|
||||
"array": {
|
||||
Type: schemapb.DataType_Array,
|
||||
Val: &schemapb.TemplateValue_ArrayVal{
|
||||
ArrayVal: &schemapb.TemplateArrayValue{
|
||||
Array: []*schemapb.TemplateValue{
|
||||
{
|
||||
Type: schemapb.DataType_Int64,
|
||||
Val: &schemapb.TemplateValue_Int64Val{
|
||||
Int64Val: 111,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: schemapb.DataType_Int64,
|
||||
Val: &schemapb.TemplateValue_Int64Val{
|
||||
Int64Val: 222,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: schemapb.DataType_Int64,
|
||||
Val: &schemapb.TemplateValue_Int64Val{
|
||||
Int64Val: 333,
|
||||
},
|
||||
},
|
||||
},
|
||||
SameType: true,
|
||||
ElementType: schemapb.DataType_Int64,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expect: map[string]*planpb.GenericValue{
|
||||
"array": {
|
||||
Val: &planpb.GenericValue_ArrayVal{
|
||||
ArrayVal: &planpb.Array{
|
||||
Array: []*planpb.GenericValue{
|
||||
{
|
||||
Val: &planpb.GenericValue_Int64Val{
|
||||
Int64Val: 111,
|
||||
},
|
||||
},
|
||||
{
|
||||
Val: &planpb.GenericValue_Int64Val{
|
||||
Int64Val: 222,
|
||||
},
|
||||
},
|
||||
{
|
||||
Val: &planpb.GenericValue_Int64Val{
|
||||
Int64Val: 333,
|
||||
},
|
||||
},
|
||||
},
|
||||
SameType: true,
|
||||
ElementType: schemapb.DataType_Int64,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
input: map[string]*schemapb.TemplateValue{
|
||||
"not_same_array": {
|
||||
Type: schemapb.DataType_Array,
|
||||
Val: &schemapb.TemplateValue_ArrayVal{
|
||||
ArrayVal: &schemapb.TemplateArrayValue{
|
||||
Array: []*schemapb.TemplateValue{
|
||||
{
|
||||
Type: schemapb.DataType_Int64,
|
||||
Val: &schemapb.TemplateValue_Int64Val{
|
||||
Int64Val: 111,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: schemapb.DataType_Float,
|
||||
Val: &schemapb.TemplateValue_FloatVal{
|
||||
FloatVal: 222.222,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: schemapb.DataType_Bool,
|
||||
Val: &schemapb.TemplateValue_BoolVal{
|
||||
BoolVal: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: schemapb.DataType_VarChar,
|
||||
Val: &schemapb.TemplateValue_StringVal{
|
||||
StringVal: "abc",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expect: map[string]*planpb.GenericValue{
|
||||
"not_same_array": {
|
||||
Val: &planpb.GenericValue_ArrayVal{
|
||||
ArrayVal: &planpb.Array{
|
||||
Array: []*planpb.GenericValue{
|
||||
{
|
||||
Val: &planpb.GenericValue_Int64Val{
|
||||
Int64Val: 111,
|
||||
},
|
||||
},
|
||||
{
|
||||
Val: &planpb.GenericValue_FloatVal{
|
||||
FloatVal: 222.222,
|
||||
},
|
||||
},
|
||||
{
|
||||
Val: &planpb.GenericValue_BoolVal{
|
||||
BoolVal: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
Val: &planpb.GenericValue_StringVal{
|
||||
StringVal: "abc",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
output, err := UnmarshalExpressionValues(tt.input)
|
||||
assert.Nil(t, err)
|
||||
assert.EqualValues(t, tt.expect, output)
|
||||
}
|
||||
}
|
||||
|
||||
func generateExpressionFieldData(dataType schemapb.DataType, data interface{}) *schemapb.TemplateValue {
|
||||
switch dataType {
|
||||
case schemapb.DataType_Bool:
|
||||
return &schemapb.TemplateValue{
|
||||
Type: dataType,
|
||||
Val: &schemapb.TemplateValue_BoolVal{
|
||||
BoolVal: data.(bool),
|
||||
},
|
||||
}
|
||||
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64:
|
||||
return &schemapb.TemplateValue{
|
||||
Type: dataType,
|
||||
Val: &schemapb.TemplateValue_Int64Val{
|
||||
Int64Val: data.(int64),
|
||||
},
|
||||
}
|
||||
case schemapb.DataType_Float, schemapb.DataType_Double:
|
||||
return &schemapb.TemplateValue{
|
||||
Type: dataType,
|
||||
Val: &schemapb.TemplateValue_FloatVal{
|
||||
FloatVal: data.(float64),
|
||||
},
|
||||
}
|
||||
case schemapb.DataType_String, schemapb.DataType_VarChar:
|
||||
return &schemapb.TemplateValue{
|
||||
Type: dataType,
|
||||
Val: &schemapb.TemplateValue_StringVal{
|
||||
StringVal: data.(string),
|
||||
},
|
||||
}
|
||||
case schemapb.DataType_Array:
|
||||
// Handle array data here
|
||||
// Assume the inner data is already in an appropriate format.
|
||||
// Placeholder for array implementation.
|
||||
// You might want to define a recursive approach based on the data structure.
|
||||
value := data.([]interface{})
|
||||
arrayData := make([]*schemapb.TemplateValue, len(value))
|
||||
elementType := schemapb.DataType_None
|
||||
sameType := true
|
||||
for i, v := range value {
|
||||
element := v.(*schemapb.TemplateValue)
|
||||
arrayData[i] = element
|
||||
if elementType == schemapb.DataType_None {
|
||||
elementType = element.GetType()
|
||||
} else if elementType != element.GetType() {
|
||||
sameType = false
|
||||
elementType = schemapb.DataType_JSON
|
||||
}
|
||||
}
|
||||
return &schemapb.TemplateValue{
|
||||
Type: dataType,
|
||||
Val: &schemapb.TemplateValue_ArrayVal{
|
||||
ArrayVal: &schemapb.TemplateArrayValue{
|
||||
Array: arrayData,
|
||||
ElementType: elementType,
|
||||
SameType: sameType,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
231
internal/parser/planparserv2/fill_expression_value.go
Normal file
231
internal/parser/planparserv2/fill_expression_value.go
Normal file
@ -0,0 +1,231 @@
|
||||
package planparserv2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
||||
"github.com/milvus-io/milvus/internal/proto/planpb"
|
||||
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
||||
)
|
||||
|
||||
func FillExpressionValue(expr *planpb.Expr, templateValues map[string]*planpb.GenericValue) error {
|
||||
if !expr.GetIsTemplate() {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch e := expr.GetExpr().(type) {
|
||||
case *planpb.Expr_TermExpr:
|
||||
return FillTermExpressionValue(e.TermExpr, templateValues)
|
||||
case *planpb.Expr_UnaryExpr:
|
||||
return FillExpressionValue(e.UnaryExpr.GetChild(), templateValues)
|
||||
case *planpb.Expr_BinaryExpr:
|
||||
if err := FillExpressionValue(e.BinaryExpr.GetLeft(), templateValues); err != nil {
|
||||
return err
|
||||
}
|
||||
return FillExpressionValue(e.BinaryExpr.GetRight(), templateValues)
|
||||
case *planpb.Expr_UnaryRangeExpr:
|
||||
return FillUnaryRangeExpressionValue(e.UnaryRangeExpr, templateValues)
|
||||
case *planpb.Expr_BinaryRangeExpr:
|
||||
return FillBinaryRangeExpressionValue(e.BinaryRangeExpr, templateValues)
|
||||
case *planpb.Expr_BinaryArithOpEvalRangeExpr:
|
||||
return FillBinaryArithOpEvalRangeExpressionValue(e.BinaryArithOpEvalRangeExpr, templateValues)
|
||||
case *planpb.Expr_BinaryArithExpr:
|
||||
if err := FillExpressionValue(e.BinaryArithExpr.GetLeft(), templateValues); err != nil {
|
||||
return err
|
||||
}
|
||||
return FillExpressionValue(e.BinaryArithExpr.GetRight(), templateValues)
|
||||
case *planpb.Expr_JsonContainsExpr:
|
||||
return FillJSONContainsExpressionValue(e.JsonContainsExpr, templateValues)
|
||||
default:
|
||||
return fmt.Errorf("this expression no need to fill placeholder with expr type: %T", e)
|
||||
}
|
||||
}
|
||||
|
||||
func FillTermExpressionValue(expr *planpb.TermExpr, templateValues map[string]*planpb.GenericValue) error {
|
||||
value, ok := templateValues[expr.GetTemplateVariableName()]
|
||||
if !ok && expr.GetValues() == nil {
|
||||
return fmt.Errorf("the value of expression template variable name {%s} is not found", expr.GetTemplateVariableName())
|
||||
}
|
||||
|
||||
if value == nil || value.GetArrayVal() == nil {
|
||||
return fmt.Errorf("the value of term expression template variable {%s} is not array", expr.GetTemplateVariableName())
|
||||
}
|
||||
dataType := expr.GetColumnInfo().GetDataType()
|
||||
if typeutil.IsArrayType(dataType) {
|
||||
if len(expr.GetColumnInfo().GetNestedPath()) != 0 {
|
||||
dataType = expr.GetColumnInfo().GetElementType()
|
||||
}
|
||||
}
|
||||
|
||||
array := value.GetArrayVal().GetArray()
|
||||
values := make([]*planpb.GenericValue, len(array))
|
||||
for i, e := range array {
|
||||
castedValue, err := castValue(dataType, e)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
values[i] = castedValue
|
||||
}
|
||||
expr.Values = values
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func FillUnaryRangeExpressionValue(expr *planpb.UnaryRangeExpr, templateValues map[string]*planpb.GenericValue) error {
|
||||
value, ok := templateValues[expr.GetTemplateVariableName()]
|
||||
if !ok {
|
||||
return fmt.Errorf("the value of expression template variable name {%s} is not found", expr.GetTemplateVariableName())
|
||||
}
|
||||
|
||||
dataType := expr.GetColumnInfo().GetDataType()
|
||||
if typeutil.IsArrayType(dataType) {
|
||||
if len(expr.GetColumnInfo().GetNestedPath()) != 0 {
|
||||
dataType = expr.GetColumnInfo().GetElementType()
|
||||
}
|
||||
}
|
||||
|
||||
castedValue, err := castValue(dataType, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
expr.Value = castedValue
|
||||
return nil
|
||||
}
|
||||
|
||||
func FillBinaryRangeExpressionValue(expr *planpb.BinaryRangeExpr, templateValues map[string]*planpb.GenericValue) error {
|
||||
var ok bool
|
||||
dataType := expr.GetColumnInfo().GetDataType()
|
||||
if typeutil.IsArrayType(dataType) && len(expr.GetColumnInfo().GetNestedPath()) != 0 {
|
||||
dataType = expr.GetColumnInfo().GetElementType()
|
||||
}
|
||||
lowerValue := expr.GetLowerValue()
|
||||
if lowerValue == nil || expr.GetLowerTemplateVariableName() != "" {
|
||||
lowerValue, ok = templateValues[expr.GetLowerTemplateVariableName()]
|
||||
if !ok {
|
||||
return fmt.Errorf("the lower value of expression template variable name {%s} is not found", expr.GetLowerTemplateVariableName())
|
||||
}
|
||||
castedLowerValue, err := castValue(dataType, lowerValue)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
expr.LowerValue = castedLowerValue
|
||||
}
|
||||
|
||||
upperValue := expr.GetUpperValue()
|
||||
if upperValue == nil || expr.GetUpperTemplateVariableName() != "" {
|
||||
upperValue, ok = templateValues[expr.GetUpperTemplateVariableName()]
|
||||
if !ok {
|
||||
return fmt.Errorf("the upper value of expression template variable name {%s} is not found", expr.GetUpperTemplateVariableName())
|
||||
}
|
||||
|
||||
castedUpperValue, err := castValue(dataType, upperValue)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
expr.UpperValue = castedUpperValue
|
||||
}
|
||||
|
||||
if !(expr.GetLowerInclusive() && expr.GetUpperInclusive()) {
|
||||
if getGenericValue(GreaterEqual(lowerValue, upperValue)).GetBoolVal() {
|
||||
return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
}
|
||||
} else {
|
||||
if getGenericValue(Greater(lowerValue, upperValue)).GetBoolVal() {
|
||||
return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func FillBinaryArithOpEvalRangeExpressionValue(expr *planpb.BinaryArithOpEvalRangeExpr, templateValues map[string]*planpb.GenericValue) error {
|
||||
var dataType schemapb.DataType
|
||||
var err error
|
||||
var ok bool
|
||||
|
||||
if expr.ArithOp == planpb.ArithOpType_ArrayLength {
|
||||
dataType = schemapb.DataType_Int64
|
||||
} else {
|
||||
operand := expr.GetRightOperand()
|
||||
if operand == nil || expr.GetOperandTemplateVariableName() != "" {
|
||||
operand, ok = templateValues[expr.GetOperandTemplateVariableName()]
|
||||
if !ok {
|
||||
return fmt.Errorf("the right operand value of expression template variable name {%s} is not found", expr.GetOperandTemplateVariableName())
|
||||
}
|
||||
}
|
||||
|
||||
operandExpr := toValueExpr(operand)
|
||||
lDataType, rDataType := expr.GetColumnInfo().GetDataType(), operandExpr.dataType
|
||||
if typeutil.IsArrayType(expr.GetColumnInfo().GetDataType()) {
|
||||
lDataType = expr.GetColumnInfo().GetElementType()
|
||||
}
|
||||
|
||||
if err = checkValidModArith(expr.GetArithOp(), expr.GetColumnInfo().GetDataType(), expr.GetColumnInfo().GetElementType(),
|
||||
rDataType, schemapb.DataType_None); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if operand.GetArrayVal() != nil {
|
||||
return fmt.Errorf("can not comparisons array directly")
|
||||
}
|
||||
|
||||
dataType, err = getTargetType(lDataType, rDataType)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
castedOperand, err := castValue(dataType, operand)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
expr.RightOperand = castedOperand
|
||||
}
|
||||
|
||||
value := expr.GetValue()
|
||||
if expr.GetValue() == nil || expr.GetValueTemplateVariableName() != "" {
|
||||
value, ok = templateValues[expr.GetValueTemplateVariableName()]
|
||||
if !ok {
|
||||
return fmt.Errorf("the value of expression template variable name {%s} is not found", expr.GetValueTemplateVariableName())
|
||||
}
|
||||
}
|
||||
castedValue, err := castValue(dataType, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
expr.Value = castedValue
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func FillJSONContainsExpressionValue(expr *planpb.JSONContainsExpr, templateValues map[string]*planpb.GenericValue) error {
|
||||
if expr.GetElements() != nil && expr.GetTemplateVariableName() == "" {
|
||||
return nil
|
||||
}
|
||||
value, ok := templateValues[expr.GetTemplateVariableName()]
|
||||
if !ok {
|
||||
return fmt.Errorf("the value of expression template variable name {%s} is not found", expr.GetTemplateVariableName())
|
||||
}
|
||||
if err := checkContainsElement(toColumnExpr(expr.GetColumnInfo()), expr.GetOp(), value); err != nil {
|
||||
return err
|
||||
}
|
||||
dataType := expr.GetColumnInfo().GetDataType()
|
||||
if typeutil.IsArrayType(dataType) {
|
||||
dataType = expr.GetColumnInfo().GetElementType()
|
||||
}
|
||||
if expr.GetOp() == planpb.JSONContainsExpr_Contains {
|
||||
castedValue, err := castValue(dataType, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
expr.Elements = append(expr.Elements, castedValue)
|
||||
} else {
|
||||
for _, e := range value.GetArrayVal().GetArray() {
|
||||
castedValue, err := castValue(dataType, e)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
expr.Elements = append(expr.Elements, castedValue)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
541
internal/parser/planparserv2/fill_expression_value_test.go
Normal file
541
internal/parser/planparserv2/fill_expression_value_test.go
Normal file
@ -0,0 +1,541 @@
|
||||
package planparserv2
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
||||
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
||||
)
|
||||
|
||||
type FillExpressionValueSuite struct {
|
||||
suite.Suite
|
||||
}
|
||||
|
||||
func TestFillExpressionValue(t *testing.T) {
|
||||
suite.Run(t, new(FillExpressionValueSuite))
|
||||
}
|
||||
|
||||
type testcase struct {
|
||||
expr string
|
||||
values map[string]*schemapb.TemplateValue
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) assertValidExpr(helper *typeutil.SchemaHelper, exprStr string, templateValues map[string]*schemapb.TemplateValue) {
|
||||
expr, err := ParseExpr(helper, exprStr, templateValues)
|
||||
s.NoError(err, exprStr)
|
||||
s.NotNil(expr, exprStr)
|
||||
ShowExpr(expr)
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) assertInvalidExpr(helper *typeutil.SchemaHelper, exprStr string, templateValues map[string]*schemapb.TemplateValue) {
|
||||
expr, err := ParseExpr(helper, exprStr, templateValues)
|
||||
s.Error(err, exprStr)
|
||||
s.Nil(expr, exprStr)
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) TestTermExpr() {
|
||||
s.Run("normal case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field in {age}`, map[string]*schemapb.TemplateValue{
|
||||
"age": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(4)),
|
||||
}),
|
||||
}},
|
||||
{`FloatField in {age}`, map[string]*schemapb.TemplateValue{
|
||||
"age": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Float, 1.1),
|
||||
generateExpressionFieldData(schemapb.DataType_Float, 2.2),
|
||||
generateExpressionFieldData(schemapb.DataType_Float, 3.3),
|
||||
generateExpressionFieldData(schemapb.DataType_Float, 4.4),
|
||||
}),
|
||||
}},
|
||||
{`A in {list}`, map[string]*schemapb.TemplateValue{
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Float, 2.2),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}),
|
||||
}},
|
||||
{`ArrayField in {list}`, map[string]*schemapb.TemplateValue{
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}),
|
||||
generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(4)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(5)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(6)),
|
||||
}),
|
||||
generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(7)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(8)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(9)),
|
||||
}),
|
||||
}),
|
||||
}},
|
||||
{`ArrayField[0] in {list}`, map[string]*schemapb.TemplateValue{
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}),
|
||||
}},
|
||||
{`Int64Field in {empty_list}`, map[string]*schemapb.TemplateValue{
|
||||
"empty_list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{}),
|
||||
}},
|
||||
}
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertValidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
|
||||
s.Run("failed case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field in {age}`, map[string]*schemapb.TemplateValue{
|
||||
"age": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "def"),
|
||||
}),
|
||||
}},
|
||||
{`StringField in {list}`, map[string]*schemapb.TemplateValue{
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Float, 2.2),
|
||||
generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}),
|
||||
}},
|
||||
{"ArrayField[0] in {list}", map[string]*schemapb.TemplateValue{
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Float, 3.2),
|
||||
}),
|
||||
}},
|
||||
{"Int64Field not in {not_list}", map[string]*schemapb.TemplateValue{
|
||||
"not_list": generateExpressionFieldData(schemapb.DataType_Int64, int64(33)),
|
||||
}},
|
||||
{"Int64Field not in {not_list}", map[string]*schemapb.TemplateValue{
|
||||
"age": generateExpressionFieldData(schemapb.DataType_Int64, int64(33)),
|
||||
}},
|
||||
}
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertInvalidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) TestUnaryRange() {
|
||||
s.Run("normal case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field == 10`, nil},
|
||||
{`Int64Field > {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
}},
|
||||
{`FloatField < {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Float, float64(12.3)),
|
||||
}},
|
||||
{`DoubleField != {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 3.5),
|
||||
}},
|
||||
{`ArrayField[0] >= {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}},
|
||||
{`BoolField == {bool}`, map[string]*schemapb.TemplateValue{
|
||||
"bool": generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}},
|
||||
{`{str} != StringField`, map[string]*schemapb.TemplateValue{
|
||||
"str": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
}},
|
||||
{`{target} > Int64Field`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
}},
|
||||
}
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertValidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
|
||||
s.Run("failed case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field == 10.5`, nil},
|
||||
{`Int64Field > {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 11.2),
|
||||
}},
|
||||
{`FloatField < {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
}},
|
||||
{`DoubleField != {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}},
|
||||
{`ArrayField[0] >= {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 3.5),
|
||||
}},
|
||||
{`BoolField == {bool}`, map[string]*schemapb.TemplateValue{
|
||||
"bool": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
}},
|
||||
{`{str} != StringField`, map[string]*schemapb.TemplateValue{
|
||||
"str": generateExpressionFieldData(schemapb.DataType_Int64, int64(5)),
|
||||
}},
|
||||
{`{int} != StringField`, map[string]*schemapb.TemplateValue{
|
||||
"int": generateExpressionFieldData(schemapb.DataType_Int64, int64(5)),
|
||||
}},
|
||||
{`{str} != StringField`, map[string]*schemapb.TemplateValue{
|
||||
"int": generateExpressionFieldData(schemapb.DataType_Int64, int64(5)),
|
||||
}},
|
||||
}
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertInvalidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) TestBinaryRange() {
|
||||
s.Run("normal case", func() {
|
||||
testcases := []testcase{
|
||||
{`10 < Int64Field < 20`, nil},
|
||||
{`{max} > Int64Field > {min}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
{`{min} <= FloatField <= {max}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Float, float64(11)),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Float, float64(22)),
|
||||
}},
|
||||
{`{min} < DoubleField < {max}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Double, float64(11)),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Double, float64(22)),
|
||||
}},
|
||||
{`{max} >= ArrayField[0] >= {min}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
{`{max} > Int64Field >= 10`, map[string]*schemapb.TemplateValue{
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
{`30 >= Int64Field > {min}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
}},
|
||||
{`10 < Int64Field <= {max}`, map[string]*schemapb.TemplateValue{
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
{`{min} <= Int64Field < 20`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertValidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
|
||||
s.Run("failed case", func() {
|
||||
testcases := []testcase{
|
||||
{`10 < Int64Field < 20.5`, nil},
|
||||
{`{max} > Int64Field > {min}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Double, 22.5),
|
||||
}},
|
||||
{`{min} <= FloatField <= {max}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(11)),
|
||||
}},
|
||||
{`{min} < DoubleField < {max}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(33)),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
{`{max} >= ArrayField[0] >= {min}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Double, 11.5),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
{`{max} >= Int64Field >= {min}`, map[string]*schemapb.TemplateValue{
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
{`{max} > Int64Field`, map[string]*schemapb.TemplateValue{
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}},
|
||||
{`{$meta} > Int64Field`, map[string]*schemapb.TemplateValue{
|
||||
"$meta": generateExpressionFieldData(schemapb.DataType_Int64, int64(22)),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertInvalidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) TestBinaryArithOpEvalRange() {
|
||||
s.Run("normal case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field + 5.5 == 10.5`, nil},
|
||||
{`Int64Field - {offset} >= {target}`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Double, 3.5),
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 11.5),
|
||||
}},
|
||||
{`Int64Field * 3.5 <= {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 11.5),
|
||||
}},
|
||||
{`Int64Field / {offset} > 11.5`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Double, 3.5),
|
||||
}},
|
||||
{`ArrayField[0] % {offset} < 11`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}},
|
||||
{`array_length(ArrayField) == {length}`, map[string]*schemapb.TemplateValue{
|
||||
"length": generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}},
|
||||
{`array_length(ArrayField) > {length}`, map[string]*schemapb.TemplateValue{
|
||||
"length": generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertValidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
|
||||
s.Run("failed case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field + 6 == 12.5`, nil},
|
||||
{`Int64Field - {offset} == {target}`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Int64, int64(4)),
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 13.5),
|
||||
}},
|
||||
{`Int64Field * 6 == {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 13.5),
|
||||
}},
|
||||
{`Int64Field / {offset} == 11.5`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Int64, int64(6)),
|
||||
}},
|
||||
{`Int64Field % {offset} < 11`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Double, 3.5),
|
||||
}},
|
||||
{`Int64Field + {offset} < {target}`, map[string]*schemapb.TemplateValue{
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Double, 3.5),
|
||||
}},
|
||||
{`Int64Field + {offset} < {target}`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Int64, int64(15)),
|
||||
}},
|
||||
{`Int64Field + {offset} < {target}`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Int64, int64(15)),
|
||||
"target": generateExpressionFieldData(schemapb.DataType_String, "def"),
|
||||
}},
|
||||
{`ArrayField + {offset} < {target}`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Double, 3.5),
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Int64, int64(5)),
|
||||
}},
|
||||
{`ArrayField[0] + {offset} < {target}`, map[string]*schemapb.TemplateValue{
|
||||
"offset": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}),
|
||||
"target": generateExpressionFieldData(schemapb.DataType_Int64, int64(5)),
|
||||
}},
|
||||
{`array_length(ArrayField) == {length}`, map[string]*schemapb.TemplateValue{
|
||||
"length": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
for _, c := range testcases {
|
||||
s.assertInvalidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) TestJSONContainsExpression() {
|
||||
s.Run("normal case", func() {
|
||||
testcases := []testcase{
|
||||
{`json_contains(A, 5)`, nil},
|
||||
{`json_contains(A, {age})`, map[string]*schemapb.TemplateValue{
|
||||
"age": generateExpressionFieldData(schemapb.DataType_Int64, int64(18)),
|
||||
}},
|
||||
{`json_contains(A, {str})`, map[string]*schemapb.TemplateValue{
|
||||
"str": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
}},
|
||||
{`json_contains(A, {bool})`, map[string]*schemapb.TemplateValue{
|
||||
"bool": generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}},
|
||||
{`json_contains_any(JSONField, {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Double, 2.2),
|
||||
generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}),
|
||||
}},
|
||||
{`json_contains_any(JSONField, {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(4)),
|
||||
}),
|
||||
}},
|
||||
{`json_contains_any(JSONField["A"], {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(4)),
|
||||
}),
|
||||
}},
|
||||
{`json_contains_all(JSONField["A"], {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Double, 2.2),
|
||||
generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}),
|
||||
}},
|
||||
{`json_contains_all(JSONField["A"], {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}),
|
||||
generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(4)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(5)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(6)),
|
||||
}),
|
||||
}),
|
||||
}},
|
||||
{`json_contains(ArrayField, {int})`, map[string]*schemapb.TemplateValue{
|
||||
"int": generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
}},
|
||||
{`json_contains_any(ArrayField, {list})`, map[string]*schemapb.TemplateValue{
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(4)),
|
||||
}),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
|
||||
for _, c := range testcases {
|
||||
s.assertValidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
|
||||
s.Run("failed case", func() {
|
||||
testcases := []testcase{
|
||||
{`json_contains(ArrayField[0], {str})`, map[string]*schemapb.TemplateValue{
|
||||
"str": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
}},
|
||||
{`json_contains_any(JSONField, {not_array})`, map[string]*schemapb.TemplateValue{
|
||||
"not_array": generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
}},
|
||||
{`json_contains_all(JSONField, {not_array})`, map[string]*schemapb.TemplateValue{
|
||||
"not_array": generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
}},
|
||||
{`json_contains_all(JSONField, {not_array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}),
|
||||
}},
|
||||
{`json_contains_all(ArrayField, {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Double, 2.2),
|
||||
generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}),
|
||||
}},
|
||||
{`json_contains(ArrayField, {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(2)),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(3)),
|
||||
}),
|
||||
}},
|
||||
{`json_contains_any(ArrayField, {array})`, map[string]*schemapb.TemplateValue{
|
||||
"array": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(1)),
|
||||
generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Double, 2.2),
|
||||
generateExpressionFieldData(schemapb.DataType_Bool, false),
|
||||
}),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
|
||||
for _, c := range testcases {
|
||||
s.assertInvalidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (s *FillExpressionValueSuite) TestBinaryExpression() {
|
||||
s.Run("normal case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field > {int} && StringField in {list}`, map[string]*schemapb.TemplateValue{
|
||||
"int": generateExpressionFieldData(schemapb.DataType_Int64, int64(10)),
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_VarChar, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_VarChar, "def"),
|
||||
generateExpressionFieldData(schemapb.DataType_VarChar, "ghi"),
|
||||
}),
|
||||
}},
|
||||
{`{max} > FloatField >= {min} or BoolField == {bool}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(10)),
|
||||
"max": generateExpressionFieldData(schemapb.DataType_Float, 22.22),
|
||||
"bool": generateExpressionFieldData(schemapb.DataType_Bool, true),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
|
||||
for _, c := range testcases {
|
||||
s.assertValidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
|
||||
s.Run("failed case", func() {
|
||||
testcases := []testcase{
|
||||
{`Int64Field > {int} && StringField in {list}`, map[string]*schemapb.TemplateValue{
|
||||
"int": generateExpressionFieldData(schemapb.DataType_String, "abc"),
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, []interface{}{
|
||||
generateExpressionFieldData(schemapb.DataType_VarChar, "abc"),
|
||||
generateExpressionFieldData(schemapb.DataType_Int64, int64(10)),
|
||||
generateExpressionFieldData(schemapb.DataType_VarChar, "ghi"),
|
||||
}),
|
||||
}},
|
||||
{`{max} > FloatField >= {min} or BoolField == {bool}`, map[string]*schemapb.TemplateValue{
|
||||
"min": generateExpressionFieldData(schemapb.DataType_Int64, int64(10)),
|
||||
"bool": generateExpressionFieldData(schemapb.DataType_Bool, true),
|
||||
}},
|
||||
}
|
||||
|
||||
schemaH := newTestSchemaHelper(s.T())
|
||||
|
||||
for _, c := range testcases {
|
||||
s.assertInvalidExpr(schemaH, c.expr, c.values)
|
||||
}
|
||||
})
|
||||
}
|
@ -5,6 +5,8 @@ null
|
||||
'['
|
||||
','
|
||||
']'
|
||||
'{'
|
||||
'}'
|
||||
'<'
|
||||
'<='
|
||||
'>'
|
||||
@ -42,6 +44,7 @@ null
|
||||
null
|
||||
null
|
||||
null
|
||||
'$meta'
|
||||
null
|
||||
null
|
||||
null
|
||||
@ -54,6 +57,8 @@ null
|
||||
null
|
||||
null
|
||||
null
|
||||
LBRACE
|
||||
RBRACE
|
||||
LT
|
||||
LE
|
||||
GT
|
||||
@ -91,6 +96,7 @@ BooleanConstant
|
||||
IntegerConstant
|
||||
FloatingConstant
|
||||
Identifier
|
||||
Meta
|
||||
StringLiteral
|
||||
JSONIdentifier
|
||||
Whitespace
|
||||
@ -101,4 +107,4 @@ expr
|
||||
|
||||
|
||||
atn:
|
||||
[4, 1, 46, 139, 2, 0, 7, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 18, 8, 0, 10, 0, 12, 0, 21, 9, 0, 1, 0, 3, 0, 24, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 67, 8, 0, 10, 0, 12, 0, 70, 9, 0, 1, 0, 3, 0, 73, 8, 0, 3, 0, 75, 8, 0, 1, 0, 1, 0, 1, 0, 3, 0, 80, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 96, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 134, 8, 0, 10, 0, 12, 0, 137, 9, 0, 1, 0, 0, 1, 0, 1, 0, 0, 12, 2, 0, 15, 16, 28, 29, 2, 0, 32, 32, 35, 35, 2, 0, 33, 33, 36, 36, 2, 0, 34, 34, 37, 37, 2, 0, 42, 42, 44, 44, 1, 0, 17, 19, 1, 0, 15, 16, 1, 0, 21, 22, 1, 0, 6, 7, 1, 0, 8, 9, 1, 0, 6, 9, 1, 0, 10, 11, 174, 0, 79, 1, 0, 0, 0, 2, 3, 6, 0, -1, 0, 3, 80, 5, 40, 0, 0, 4, 80, 5, 41, 0, 0, 5, 80, 5, 39, 0, 0, 6, 80, 5, 43, 0, 0, 7, 80, 5, 42, 0, 0, 8, 80, 5, 44, 0, 0, 9, 10, 5, 1, 0, 0, 10, 11, 3, 0, 0, 0, 11, 12, 5, 2, 0, 0, 12, 80, 1, 0, 0, 0, 13, 14, 5, 3, 0, 0, 14, 19, 3, 0, 0, 0, 15, 16, 5, 4, 0, 0, 16, 18, 3, 0, 0, 0, 17, 15, 1, 0, 0, 0, 18, 21, 1, 0, 0, 0, 19, 17, 1, 0, 0, 0, 19, 20, 1, 0, 0, 0, 20, 23, 1, 0, 0, 0, 21, 19, 1, 0, 0, 0, 22, 24, 5, 4, 0, 0, 23, 22, 1, 0, 0, 0, 23, 24, 1, 0, 0, 0, 24, 25, 1, 0, 0, 0, 25, 26, 5, 5, 0, 0, 26, 80, 1, 0, 0, 0, 27, 80, 5, 31, 0, 0, 28, 29, 5, 14, 0, 0, 29, 30, 5, 1, 0, 0, 30, 31, 5, 42, 0, 0, 31, 32, 5, 4, 0, 0, 32, 33, 5, 43, 0, 0, 33, 80, 5, 2, 0, 0, 34, 35, 7, 0, 0, 0, 35, 80, 3, 0, 0, 20, 36, 37, 7, 1, 0, 0, 37, 38, 5, 1, 0, 0, 38, 39, 3, 0, 0, 0, 39, 40, 5, 4, 0, 0, 40, 41, 3, 0, 0, 0, 41, 42, 5, 2, 0, 0, 42, 80, 1, 0, 0, 0, 43, 44, 7, 2, 0, 0, 44, 45, 5, 1, 0, 0, 45, 46, 3, 0, 0, 0, 46, 47, 5, 4, 0, 0, 47, 48, 3, 0, 0, 0, 48, 49, 5, 2, 0, 0, 49, 80, 1, 0, 0, 0, 50, 51, 7, 3, 0, 0, 51, 52, 5, 1, 0, 0, 52, 53, 3, 0, 0, 0, 53, 54, 5, 4, 0, 0, 54, 55, 3, 0, 0, 0, 55, 56, 5, 2, 0, 0, 56, 80, 1, 0, 0, 0, 57, 58, 5, 38, 0, 0, 58, 59, 5, 1, 0, 0, 59, 60, 7, 4, 0, 0, 60, 80, 5, 2, 0, 0, 61, 62, 5, 42, 0, 0, 62, 74, 5, 1, 0, 0, 63, 68, 3, 0, 0, 0, 64, 65, 5, 4, 0, 0, 65, 67, 3, 0, 0, 0, 66, 64, 1, 0, 0, 0, 67, 70, 1, 0, 0, 0, 68, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 72, 1, 0, 0, 0, 70, 68, 1, 0, 0, 0, 71, 73, 5, 4, 0, 0, 72, 71, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 75, 1, 0, 0, 0, 74, 63, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 80, 5, 2, 0, 0, 77, 78, 5, 13, 0, 0, 78, 80, 3, 0, 0, 1, 79, 2, 1, 0, 0, 0, 79, 4, 1, 0, 0, 0, 79, 5, 1, 0, 0, 0, 79, 6, 1, 0, 0, 0, 79, 7, 1, 0, 0, 0, 79, 8, 1, 0, 0, 0, 79, 9, 1, 0, 0, 0, 79, 13, 1, 0, 0, 0, 79, 27, 1, 0, 0, 0, 79, 28, 1, 0, 0, 0, 79, 34, 1, 0, 0, 0, 79, 36, 1, 0, 0, 0, 79, 43, 1, 0, 0, 0, 79, 50, 1, 0, 0, 0, 79, 57, 1, 0, 0, 0, 79, 61, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 80, 135, 1, 0, 0, 0, 81, 82, 10, 21, 0, 0, 82, 83, 5, 20, 0, 0, 83, 134, 3, 0, 0, 22, 84, 85, 10, 19, 0, 0, 85, 86, 7, 5, 0, 0, 86, 134, 3, 0, 0, 20, 87, 88, 10, 18, 0, 0, 88, 89, 7, 6, 0, 0, 89, 134, 3, 0, 0, 19, 90, 91, 10, 17, 0, 0, 91, 92, 7, 7, 0, 0, 92, 134, 3, 0, 0, 18, 93, 95, 10, 16, 0, 0, 94, 96, 5, 29, 0, 0, 95, 94, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 5, 30, 0, 0, 98, 134, 3, 0, 0, 17, 99, 100, 10, 10, 0, 0, 100, 101, 7, 8, 0, 0, 101, 102, 7, 4, 0, 0, 102, 103, 7, 8, 0, 0, 103, 134, 3, 0, 0, 11, 104, 105, 10, 9, 0, 0, 105, 106, 7, 9, 0, 0, 106, 107, 7, 4, 0, 0, 107, 108, 7, 9, 0, 0, 108, 134, 3, 0, 0, 10, 109, 110, 10, 8, 0, 0, 110, 111, 7, 10, 0, 0, 111, 134, 3, 0, 0, 9, 112, 113, 10, 7, 0, 0, 113, 114, 7, 11, 0, 0, 114, 134, 3, 0, 0, 8, 115, 116, 10, 6, 0, 0, 116, 117, 5, 23, 0, 0, 117, 134, 3, 0, 0, 7, 118, 119, 10, 5, 0, 0, 119, 120, 5, 25, 0, 0, 120, 134, 3, 0, 0, 6, 121, 122, 10, 4, 0, 0, 122, 123, 5, 24, 0, 0, 123, 134, 3, 0, 0, 5, 124, 125, 10, 3, 0, 0, 125, 126, 5, 26, 0, 0, 126, 134, 3, 0, 0, 4, 127, 128, 10, 2, 0, 0, 128, 129, 5, 27, 0, 0, 129, 134, 3, 0, 0, 3, 130, 131, 10, 23, 0, 0, 131, 132, 5, 12, 0, 0, 132, 134, 5, 43, 0, 0, 133, 81, 1, 0, 0, 0, 133, 84, 1, 0, 0, 0, 133, 87, 1, 0, 0, 0, 133, 90, 1, 0, 0, 0, 133, 93, 1, 0, 0, 0, 133, 99, 1, 0, 0, 0, 133, 104, 1, 0, 0, 0, 133, 109, 1, 0, 0, 0, 133, 112, 1, 0, 0, 0, 133, 115, 1, 0, 0, 0, 133, 118, 1, 0, 0, 0, 133, 121, 1, 0, 0, 0, 133, 124, 1, 0, 0, 0, 133, 127, 1, 0, 0, 0, 133, 130, 1, 0, 0, 0, 134, 137, 1, 0, 0, 0, 135, 133, 1, 0, 0, 0, 135, 136, 1, 0, 0, 0, 136, 1, 1, 0, 0, 0, 137, 135, 1, 0, 0, 0, 9, 19, 23, 68, 72, 74, 79, 95, 133, 135]
|
||||
[4, 1, 49, 142, 2, 0, 7, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 21, 8, 0, 10, 0, 12, 0, 24, 9, 0, 1, 0, 3, 0, 27, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 70, 8, 0, 10, 0, 12, 0, 73, 9, 0, 1, 0, 3, 0, 76, 8, 0, 3, 0, 78, 8, 0, 1, 0, 1, 0, 1, 0, 3, 0, 83, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 99, 8, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 137, 8, 0, 10, 0, 12, 0, 140, 9, 0, 1, 0, 0, 1, 0, 1, 0, 0, 13, 1, 0, 44, 45, 2, 0, 17, 18, 30, 31, 2, 0, 34, 34, 37, 37, 2, 0, 35, 35, 38, 38, 2, 0, 36, 36, 39, 39, 2, 0, 44, 44, 47, 47, 1, 0, 19, 21, 1, 0, 17, 18, 1, 0, 23, 24, 1, 0, 8, 9, 1, 0, 10, 11, 1, 0, 8, 11, 1, 0, 12, 13, 178, 0, 82, 1, 0, 0, 0, 2, 3, 6, 0, -1, 0, 3, 83, 5, 42, 0, 0, 4, 83, 5, 43, 0, 0, 5, 83, 5, 41, 0, 0, 6, 83, 5, 46, 0, 0, 7, 83, 7, 0, 0, 0, 8, 83, 5, 47, 0, 0, 9, 10, 5, 6, 0, 0, 10, 11, 5, 44, 0, 0, 11, 83, 5, 7, 0, 0, 12, 13, 5, 1, 0, 0, 13, 14, 3, 0, 0, 0, 14, 15, 5, 2, 0, 0, 15, 83, 1, 0, 0, 0, 16, 17, 5, 3, 0, 0, 17, 22, 3, 0, 0, 0, 18, 19, 5, 4, 0, 0, 19, 21, 3, 0, 0, 0, 20, 18, 1, 0, 0, 0, 21, 24, 1, 0, 0, 0, 22, 20, 1, 0, 0, 0, 22, 23, 1, 0, 0, 0, 23, 26, 1, 0, 0, 0, 24, 22, 1, 0, 0, 0, 25, 27, 5, 4, 0, 0, 26, 25, 1, 0, 0, 0, 26, 27, 1, 0, 0, 0, 27, 28, 1, 0, 0, 0, 28, 29, 5, 5, 0, 0, 29, 83, 1, 0, 0, 0, 30, 83, 5, 33, 0, 0, 31, 32, 5, 16, 0, 0, 32, 33, 5, 1, 0, 0, 33, 34, 5, 44, 0, 0, 34, 35, 5, 4, 0, 0, 35, 36, 5, 46, 0, 0, 36, 83, 5, 2, 0, 0, 37, 38, 7, 1, 0, 0, 38, 83, 3, 0, 0, 20, 39, 40, 7, 2, 0, 0, 40, 41, 5, 1, 0, 0, 41, 42, 3, 0, 0, 0, 42, 43, 5, 4, 0, 0, 43, 44, 3, 0, 0, 0, 44, 45, 5, 2, 0, 0, 45, 83, 1, 0, 0, 0, 46, 47, 7, 3, 0, 0, 47, 48, 5, 1, 0, 0, 48, 49, 3, 0, 0, 0, 49, 50, 5, 4, 0, 0, 50, 51, 3, 0, 0, 0, 51, 52, 5, 2, 0, 0, 52, 83, 1, 0, 0, 0, 53, 54, 7, 4, 0, 0, 54, 55, 5, 1, 0, 0, 55, 56, 3, 0, 0, 0, 56, 57, 5, 4, 0, 0, 57, 58, 3, 0, 0, 0, 58, 59, 5, 2, 0, 0, 59, 83, 1, 0, 0, 0, 60, 61, 5, 40, 0, 0, 61, 62, 5, 1, 0, 0, 62, 63, 7, 5, 0, 0, 63, 83, 5, 2, 0, 0, 64, 65, 5, 44, 0, 0, 65, 77, 5, 1, 0, 0, 66, 71, 3, 0, 0, 0, 67, 68, 5, 4, 0, 0, 68, 70, 3, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 73, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 75, 1, 0, 0, 0, 73, 71, 1, 0, 0, 0, 74, 76, 5, 4, 0, 0, 75, 74, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 78, 1, 0, 0, 0, 77, 66, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 83, 5, 2, 0, 0, 80, 81, 5, 15, 0, 0, 81, 83, 3, 0, 0, 1, 82, 2, 1, 0, 0, 0, 82, 4, 1, 0, 0, 0, 82, 5, 1, 0, 0, 0, 82, 6, 1, 0, 0, 0, 82, 7, 1, 0, 0, 0, 82, 8, 1, 0, 0, 0, 82, 9, 1, 0, 0, 0, 82, 12, 1, 0, 0, 0, 82, 16, 1, 0, 0, 0, 82, 30, 1, 0, 0, 0, 82, 31, 1, 0, 0, 0, 82, 37, 1, 0, 0, 0, 82, 39, 1, 0, 0, 0, 82, 46, 1, 0, 0, 0, 82, 53, 1, 0, 0, 0, 82, 60, 1, 0, 0, 0, 82, 64, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 138, 1, 0, 0, 0, 84, 85, 10, 21, 0, 0, 85, 86, 5, 22, 0, 0, 86, 137, 3, 0, 0, 22, 87, 88, 10, 19, 0, 0, 88, 89, 7, 6, 0, 0, 89, 137, 3, 0, 0, 20, 90, 91, 10, 18, 0, 0, 91, 92, 7, 7, 0, 0, 92, 137, 3, 0, 0, 19, 93, 94, 10, 17, 0, 0, 94, 95, 7, 8, 0, 0, 95, 137, 3, 0, 0, 18, 96, 98, 10, 16, 0, 0, 97, 99, 5, 31, 0, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 101, 5, 32, 0, 0, 101, 137, 3, 0, 0, 17, 102, 103, 10, 10, 0, 0, 103, 104, 7, 9, 0, 0, 104, 105, 7, 5, 0, 0, 105, 106, 7, 9, 0, 0, 106, 137, 3, 0, 0, 11, 107, 108, 10, 9, 0, 0, 108, 109, 7, 10, 0, 0, 109, 110, 7, 5, 0, 0, 110, 111, 7, 10, 0, 0, 111, 137, 3, 0, 0, 10, 112, 113, 10, 8, 0, 0, 113, 114, 7, 11, 0, 0, 114, 137, 3, 0, 0, 9, 115, 116, 10, 7, 0, 0, 116, 117, 7, 12, 0, 0, 117, 137, 3, 0, 0, 8, 118, 119, 10, 6, 0, 0, 119, 120, 5, 25, 0, 0, 120, 137, 3, 0, 0, 7, 121, 122, 10, 5, 0, 0, 122, 123, 5, 27, 0, 0, 123, 137, 3, 0, 0, 6, 124, 125, 10, 4, 0, 0, 125, 126, 5, 26, 0, 0, 126, 137, 3, 0, 0, 5, 127, 128, 10, 3, 0, 0, 128, 129, 5, 28, 0, 0, 129, 137, 3, 0, 0, 4, 130, 131, 10, 2, 0, 0, 131, 132, 5, 29, 0, 0, 132, 137, 3, 0, 0, 3, 133, 134, 10, 23, 0, 0, 134, 135, 5, 14, 0, 0, 135, 137, 5, 46, 0, 0, 136, 84, 1, 0, 0, 0, 136, 87, 1, 0, 0, 0, 136, 90, 1, 0, 0, 0, 136, 93, 1, 0, 0, 0, 136, 96, 1, 0, 0, 0, 136, 102, 1, 0, 0, 0, 136, 107, 1, 0, 0, 0, 136, 112, 1, 0, 0, 0, 136, 115, 1, 0, 0, 0, 136, 118, 1, 0, 0, 0, 136, 121, 1, 0, 0, 0, 136, 124, 1, 0, 0, 0, 136, 127, 1, 0, 0, 0, 136, 130, 1, 0, 0, 0, 136, 133, 1, 0, 0, 0, 137, 140, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 1, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 9, 22, 26, 71, 75, 77, 82, 98, 136, 138]
|
@ -3,67 +3,73 @@ T__1=2
|
||||
T__2=3
|
||||
T__3=4
|
||||
T__4=5
|
||||
LT=6
|
||||
LE=7
|
||||
GT=8
|
||||
GE=9
|
||||
EQ=10
|
||||
NE=11
|
||||
LIKE=12
|
||||
EXISTS=13
|
||||
TEXTMATCH=14
|
||||
ADD=15
|
||||
SUB=16
|
||||
MUL=17
|
||||
DIV=18
|
||||
MOD=19
|
||||
POW=20
|
||||
SHL=21
|
||||
SHR=22
|
||||
BAND=23
|
||||
BOR=24
|
||||
BXOR=25
|
||||
AND=26
|
||||
OR=27
|
||||
BNOT=28
|
||||
NOT=29
|
||||
IN=30
|
||||
EmptyArray=31
|
||||
JSONContains=32
|
||||
JSONContainsAll=33
|
||||
JSONContainsAny=34
|
||||
ArrayContains=35
|
||||
ArrayContainsAll=36
|
||||
ArrayContainsAny=37
|
||||
ArrayLength=38
|
||||
BooleanConstant=39
|
||||
IntegerConstant=40
|
||||
FloatingConstant=41
|
||||
Identifier=42
|
||||
StringLiteral=43
|
||||
JSONIdentifier=44
|
||||
Whitespace=45
|
||||
Newline=46
|
||||
LBRACE=6
|
||||
RBRACE=7
|
||||
LT=8
|
||||
LE=9
|
||||
GT=10
|
||||
GE=11
|
||||
EQ=12
|
||||
NE=13
|
||||
LIKE=14
|
||||
EXISTS=15
|
||||
TEXTMATCH=16
|
||||
ADD=17
|
||||
SUB=18
|
||||
MUL=19
|
||||
DIV=20
|
||||
MOD=21
|
||||
POW=22
|
||||
SHL=23
|
||||
SHR=24
|
||||
BAND=25
|
||||
BOR=26
|
||||
BXOR=27
|
||||
AND=28
|
||||
OR=29
|
||||
BNOT=30
|
||||
NOT=31
|
||||
IN=32
|
||||
EmptyArray=33
|
||||
JSONContains=34
|
||||
JSONContainsAll=35
|
||||
JSONContainsAny=36
|
||||
ArrayContains=37
|
||||
ArrayContainsAll=38
|
||||
ArrayContainsAny=39
|
||||
ArrayLength=40
|
||||
BooleanConstant=41
|
||||
IntegerConstant=42
|
||||
FloatingConstant=43
|
||||
Identifier=44
|
||||
Meta=45
|
||||
StringLiteral=46
|
||||
JSONIdentifier=47
|
||||
Whitespace=48
|
||||
Newline=49
|
||||
'('=1
|
||||
')'=2
|
||||
'['=3
|
||||
','=4
|
||||
']'=5
|
||||
'<'=6
|
||||
'<='=7
|
||||
'>'=8
|
||||
'>='=9
|
||||
'=='=10
|
||||
'!='=11
|
||||
'+'=15
|
||||
'-'=16
|
||||
'*'=17
|
||||
'/'=18
|
||||
'%'=19
|
||||
'**'=20
|
||||
'<<'=21
|
||||
'>>'=22
|
||||
'&'=23
|
||||
'|'=24
|
||||
'^'=25
|
||||
'~'=28
|
||||
'{'=6
|
||||
'}'=7
|
||||
'<'=8
|
||||
'<='=9
|
||||
'>'=10
|
||||
'>='=11
|
||||
'=='=12
|
||||
'!='=13
|
||||
'+'=17
|
||||
'-'=18
|
||||
'*'=19
|
||||
'/'=20
|
||||
'%'=21
|
||||
'**'=22
|
||||
'<<'=23
|
||||
'>>'=24
|
||||
'&'=25
|
||||
'|'=26
|
||||
'^'=27
|
||||
'~'=30
|
||||
'$meta'=45
|
||||
|
File diff suppressed because one or more lines are too long
@ -3,67 +3,73 @@ T__1=2
|
||||
T__2=3
|
||||
T__3=4
|
||||
T__4=5
|
||||
LT=6
|
||||
LE=7
|
||||
GT=8
|
||||
GE=9
|
||||
EQ=10
|
||||
NE=11
|
||||
LIKE=12
|
||||
EXISTS=13
|
||||
TEXTMATCH=14
|
||||
ADD=15
|
||||
SUB=16
|
||||
MUL=17
|
||||
DIV=18
|
||||
MOD=19
|
||||
POW=20
|
||||
SHL=21
|
||||
SHR=22
|
||||
BAND=23
|
||||
BOR=24
|
||||
BXOR=25
|
||||
AND=26
|
||||
OR=27
|
||||
BNOT=28
|
||||
NOT=29
|
||||
IN=30
|
||||
EmptyArray=31
|
||||
JSONContains=32
|
||||
JSONContainsAll=33
|
||||
JSONContainsAny=34
|
||||
ArrayContains=35
|
||||
ArrayContainsAll=36
|
||||
ArrayContainsAny=37
|
||||
ArrayLength=38
|
||||
BooleanConstant=39
|
||||
IntegerConstant=40
|
||||
FloatingConstant=41
|
||||
Identifier=42
|
||||
StringLiteral=43
|
||||
JSONIdentifier=44
|
||||
Whitespace=45
|
||||
Newline=46
|
||||
LBRACE=6
|
||||
RBRACE=7
|
||||
LT=8
|
||||
LE=9
|
||||
GT=10
|
||||
GE=11
|
||||
EQ=12
|
||||
NE=13
|
||||
LIKE=14
|
||||
EXISTS=15
|
||||
TEXTMATCH=16
|
||||
ADD=17
|
||||
SUB=18
|
||||
MUL=19
|
||||
DIV=20
|
||||
MOD=21
|
||||
POW=22
|
||||
SHL=23
|
||||
SHR=24
|
||||
BAND=25
|
||||
BOR=26
|
||||
BXOR=27
|
||||
AND=28
|
||||
OR=29
|
||||
BNOT=30
|
||||
NOT=31
|
||||
IN=32
|
||||
EmptyArray=33
|
||||
JSONContains=34
|
||||
JSONContainsAll=35
|
||||
JSONContainsAny=36
|
||||
ArrayContains=37
|
||||
ArrayContainsAll=38
|
||||
ArrayContainsAny=39
|
||||
ArrayLength=40
|
||||
BooleanConstant=41
|
||||
IntegerConstant=42
|
||||
FloatingConstant=43
|
||||
Identifier=44
|
||||
Meta=45
|
||||
StringLiteral=46
|
||||
JSONIdentifier=47
|
||||
Whitespace=48
|
||||
Newline=49
|
||||
'('=1
|
||||
')'=2
|
||||
'['=3
|
||||
','=4
|
||||
']'=5
|
||||
'<'=6
|
||||
'<='=7
|
||||
'>'=8
|
||||
'>='=9
|
||||
'=='=10
|
||||
'!='=11
|
||||
'+'=15
|
||||
'-'=16
|
||||
'*'=17
|
||||
'/'=18
|
||||
'%'=19
|
||||
'**'=20
|
||||
'<<'=21
|
||||
'>>'=22
|
||||
'&'=23
|
||||
'|'=24
|
||||
'^'=25
|
||||
'~'=28
|
||||
'{'=6
|
||||
'}'=7
|
||||
'<'=8
|
||||
'<='=9
|
||||
'>'=10
|
||||
'>='=11
|
||||
'=='=12
|
||||
'!='=13
|
||||
'+'=17
|
||||
'-'=18
|
||||
'*'=19
|
||||
'/'=20
|
||||
'%'=21
|
||||
'**'=22
|
||||
'<<'=23
|
||||
'>>'=24
|
||||
'&'=25
|
||||
'|'=26
|
||||
'^'=27
|
||||
'~'=30
|
||||
'$meta'=45
|
||||
|
@ -47,6 +47,10 @@ func (v *BasePlanVisitor) VisitLogicalAnd(ctx *LogicalAndContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BasePlanVisitor) VisitTemplateVariable(ctx *TemplateVariableContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BasePlanVisitor) VisitEquality(ctx *EqualityContext) interface{} {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
@ -43,37 +43,39 @@ func planlexerLexerInit() {
|
||||
"DEFAULT_MODE",
|
||||
}
|
||||
staticData.LiteralNames = []string{
|
||||
"", "'('", "')'", "'['", "','", "']'", "'<'", "'<='", "'>'", "'>='",
|
||||
"'=='", "'!='", "", "", "", "'+'", "'-'", "'*'", "'/'", "'%'", "'**'",
|
||||
"'<<'", "'>>'", "'&'", "'|'", "'^'", "", "", "'~'",
|
||||
"", "'('", "')'", "'['", "','", "']'", "'{'", "'}'", "'<'", "'<='",
|
||||
"'>'", "'>='", "'=='", "'!='", "", "", "", "'+'", "'-'", "'*'", "'/'",
|
||||
"'%'", "'**'", "'<<'", "'>>'", "'&'", "'|'", "'^'", "", "", "'~'", "",
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "'$meta'",
|
||||
}
|
||||
staticData.SymbolicNames = []string{
|
||||
"", "", "", "", "", "", "LT", "LE", "GT", "GE", "EQ", "NE", "LIKE",
|
||||
"EXISTS", "TEXTMATCH", "ADD", "SUB", "MUL", "DIV", "MOD", "POW", "SHL",
|
||||
"SHR", "BAND", "BOR", "BXOR", "AND", "OR", "BNOT", "NOT", "IN", "EmptyArray",
|
||||
"JSONContains", "JSONContainsAll", "JSONContainsAny", "ArrayContains",
|
||||
"ArrayContainsAll", "ArrayContainsAny", "ArrayLength", "BooleanConstant",
|
||||
"IntegerConstant", "FloatingConstant", "Identifier", "StringLiteral",
|
||||
"JSONIdentifier", "Whitespace", "Newline",
|
||||
}
|
||||
staticData.RuleNames = []string{
|
||||
"T__0", "T__1", "T__2", "T__3", "T__4", "LT", "LE", "GT", "GE", "EQ",
|
||||
"NE", "LIKE", "EXISTS", "TEXTMATCH", "ADD", "SUB", "MUL", "DIV", "MOD",
|
||||
"POW", "SHL", "SHR", "BAND", "BOR", "BXOR", "AND", "OR", "BNOT", "NOT",
|
||||
"IN", "EmptyArray", "JSONContains", "JSONContainsAll", "JSONContainsAny",
|
||||
"", "", "", "", "", "", "LBRACE", "RBRACE", "LT", "LE", "GT", "GE",
|
||||
"EQ", "NE", "LIKE", "EXISTS", "TEXTMATCH", "ADD", "SUB", "MUL", "DIV",
|
||||
"MOD", "POW", "SHL", "SHR", "BAND", "BOR", "BXOR", "AND", "OR", "BNOT",
|
||||
"NOT", "IN", "EmptyArray", "JSONContains", "JSONContainsAll", "JSONContainsAny",
|
||||
"ArrayContains", "ArrayContainsAll", "ArrayContainsAny", "ArrayLength",
|
||||
"BooleanConstant", "IntegerConstant", "FloatingConstant", "Identifier",
|
||||
"StringLiteral", "JSONIdentifier", "EncodingPrefix", "DoubleSCharSequence",
|
||||
"SingleSCharSequence", "DoubleSChar", "SingleSChar", "Nondigit", "Digit",
|
||||
"BinaryConstant", "DecimalConstant", "OctalConstant", "HexadecimalConstant",
|
||||
"NonzeroDigit", "OctalDigit", "HexadecimalDigit", "HexQuad", "UniversalCharacterName",
|
||||
"DecimalFloatingConstant", "HexadecimalFloatingConstant", "FractionalConstant",
|
||||
"ExponentPart", "DigitSequence", "HexadecimalFractionalConstant", "HexadecimalDigitSequence",
|
||||
"BinaryExponentPart", "EscapeSequence", "Whitespace", "Newline",
|
||||
"Meta", "StringLiteral", "JSONIdentifier", "Whitespace", "Newline",
|
||||
}
|
||||
staticData.RuleNames = []string{
|
||||
"T__0", "T__1", "T__2", "T__3", "T__4", "LBRACE", "RBRACE", "LT", "LE",
|
||||
"GT", "GE", "EQ", "NE", "LIKE", "EXISTS", "TEXTMATCH", "ADD", "SUB",
|
||||
"MUL", "DIV", "MOD", "POW", "SHL", "SHR", "BAND", "BOR", "BXOR", "AND",
|
||||
"OR", "BNOT", "NOT", "IN", "EmptyArray", "JSONContains", "JSONContainsAll",
|
||||
"JSONContainsAny", "ArrayContains", "ArrayContainsAll", "ArrayContainsAny",
|
||||
"ArrayLength", "BooleanConstant", "IntegerConstant", "FloatingConstant",
|
||||
"Identifier", "Meta", "StringLiteral", "JSONIdentifier", "EncodingPrefix",
|
||||
"DoubleSCharSequence", "SingleSCharSequence", "DoubleSChar", "SingleSChar",
|
||||
"Nondigit", "Digit", "BinaryConstant", "DecimalConstant", "OctalConstant",
|
||||
"HexadecimalConstant", "NonzeroDigit", "OctalDigit", "HexadecimalDigit",
|
||||
"HexQuad", "UniversalCharacterName", "DecimalFloatingConstant", "HexadecimalFloatingConstant",
|
||||
"FractionalConstant", "ExponentPart", "DigitSequence", "HexadecimalFractionalConstant",
|
||||
"HexadecimalDigitSequence", "BinaryExponentPart", "EscapeSequence",
|
||||
"Whitespace", "Newline",
|
||||
}
|
||||
staticData.PredictionContextCache = antlr.NewPredictionContextCache()
|
||||
staticData.serializedATN = []int32{
|
||||
4, 0, 46, 777, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
|
||||
4, 0, 49, 789, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2,
|
||||
4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2,
|
||||
10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15,
|
||||
7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7,
|
||||
@ -86,345 +88,351 @@ func planlexerLexerInit() {
|
||||
52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57,
|
||||
7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7,
|
||||
62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67,
|
||||
2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2,
|
||||
1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7,
|
||||
1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11,
|
||||
1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 178, 8, 11, 1, 12, 1,
|
||||
12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12,
|
||||
3, 12, 192, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1,
|
||||
13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13,
|
||||
1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 221,
|
||||
8, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1,
|
||||
18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 22,
|
||||
1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 3,
|
||||
25, 253, 8, 25, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 259, 8, 26, 1, 27, 1,
|
||||
27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 267, 8, 28, 1, 29, 1, 29, 1, 29,
|
||||
1, 29, 3, 29, 273, 8, 29, 1, 30, 1, 30, 1, 30, 5, 30, 278, 8, 30, 10, 30,
|
||||
12, 30, 281, 9, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1,
|
||||
31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31,
|
||||
1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 3,
|
||||
31, 311, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32,
|
||||
1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1,
|
||||
32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32,
|
||||
1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 347, 8, 32, 1, 33, 1, 33, 1,
|
||||
2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2,
|
||||
73, 7, 73, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4,
|
||||
1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10,
|
||||
1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1,
|
||||
13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 188, 8, 13, 1, 14, 1, 14,
|
||||
1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3,
|
||||
14, 202, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15,
|
||||
1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1,
|
||||
15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 231,
|
||||
8, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1,
|
||||
20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24,
|
||||
1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3,
|
||||
27, 263, 8, 27, 1, 28, 1, 28, 1, 28, 1, 28, 3, 28, 269, 8, 28, 1, 29, 1,
|
||||
29, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 277, 8, 30, 1, 31, 1, 31, 1, 31,
|
||||
1, 31, 3, 31, 283, 8, 31, 1, 32, 1, 32, 1, 32, 5, 32, 288, 8, 32, 10, 32,
|
||||
12, 32, 291, 9, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1,
|
||||
33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33,
|
||||
1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1,
|
||||
33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33,
|
||||
3, 33, 383, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1,
|
||||
1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 3,
|
||||
33, 321, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34,
|
||||
1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1,
|
||||
34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34,
|
||||
1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3,
|
||||
34, 413, 8, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35,
|
||||
1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 357, 8, 34, 1, 35, 1, 35, 1,
|
||||
35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35,
|
||||
1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1,
|
||||
35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35,
|
||||
1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 451, 8, 35, 1,
|
||||
3, 35, 393, 8, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1,
|
||||
36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36,
|
||||
1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1,
|
||||
36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36,
|
||||
1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 489, 8, 36, 1, 37, 1, 37, 1, 37, 1,
|
||||
1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 3,
|
||||
36, 423, 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37,
|
||||
1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1,
|
||||
37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37,
|
||||
1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 3,
|
||||
37, 515, 8, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
|
||||
1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 3, 37, 461, 8, 37, 1,
|
||||
38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
|
||||
1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1,
|
||||
38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 544,
|
||||
8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 550, 8, 39, 1, 40, 1, 40, 3,
|
||||
40, 554, 8, 40, 1, 41, 1, 41, 1, 41, 5, 41, 559, 8, 41, 10, 41, 12, 41,
|
||||
562, 9, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 3, 41, 569, 8, 41, 1, 42,
|
||||
3, 42, 572, 8, 42, 1, 42, 1, 42, 3, 42, 576, 8, 42, 1, 42, 1, 42, 1, 42,
|
||||
3, 42, 581, 8, 42, 1, 42, 3, 42, 584, 8, 42, 1, 43, 1, 43, 1, 43, 1, 43,
|
||||
3, 43, 590, 8, 43, 1, 43, 1, 43, 4, 43, 594, 8, 43, 11, 43, 12, 43, 595,
|
||||
1, 44, 1, 44, 1, 44, 3, 44, 601, 8, 44, 1, 45, 4, 45, 604, 8, 45, 11, 45,
|
||||
12, 45, 605, 1, 46, 4, 46, 609, 8, 46, 11, 46, 12, 46, 610, 1, 47, 1, 47,
|
||||
1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 3, 47, 620, 8, 47, 1, 48, 1, 48, 1,
|
||||
48, 1, 48, 1, 48, 1, 48, 1, 48, 3, 48, 629, 8, 48, 1, 49, 1, 49, 1, 50,
|
||||
1, 50, 1, 51, 1, 51, 1, 51, 4, 51, 638, 8, 51, 11, 51, 12, 51, 639, 1,
|
||||
52, 1, 52, 5, 52, 644, 8, 52, 10, 52, 12, 52, 647, 9, 52, 1, 52, 3, 52,
|
||||
650, 8, 52, 1, 53, 1, 53, 5, 53, 654, 8, 53, 10, 53, 12, 53, 657, 9, 53,
|
||||
1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1,
|
||||
58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59,
|
||||
1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 684, 8, 59, 1, 60, 1, 60, 3, 60, 688,
|
||||
8, 60, 1, 60, 1, 60, 1, 60, 3, 60, 693, 8, 60, 1, 61, 1, 61, 1, 61, 1,
|
||||
61, 3, 61, 699, 8, 61, 1, 61, 1, 61, 1, 62, 3, 62, 704, 8, 62, 1, 62, 1,
|
||||
62, 1, 62, 1, 62, 1, 62, 3, 62, 711, 8, 62, 1, 63, 1, 63, 3, 63, 715, 8,
|
||||
63, 1, 63, 1, 63, 1, 64, 4, 64, 720, 8, 64, 11, 64, 12, 64, 721, 1, 65,
|
||||
3, 65, 725, 8, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 3, 65, 732, 8, 65,
|
||||
1, 66, 4, 66, 735, 8, 66, 11, 66, 12, 66, 736, 1, 67, 1, 67, 3, 67, 741,
|
||||
8, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 3, 68, 750, 8,
|
||||
68, 1, 68, 3, 68, 753, 8, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 3, 68,
|
||||
760, 8, 68, 1, 69, 4, 69, 763, 8, 69, 11, 69, 12, 69, 764, 1, 69, 1, 69,
|
||||
1, 70, 1, 70, 3, 70, 771, 8, 70, 1, 70, 3, 70, 774, 8, 70, 1, 70, 1, 70,
|
||||
0, 0, 71, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19,
|
||||
10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37,
|
||||
19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55,
|
||||
28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73,
|
||||
37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 0, 91,
|
||||
0, 93, 0, 95, 0, 97, 0, 99, 0, 101, 0, 103, 0, 105, 0, 107, 0, 109, 0,
|
||||
111, 0, 113, 0, 115, 0, 117, 0, 119, 0, 121, 0, 123, 0, 125, 0, 127, 0,
|
||||
129, 0, 131, 0, 133, 0, 135, 0, 137, 0, 139, 45, 141, 46, 1, 0, 16, 3,
|
||||
0, 76, 76, 85, 85, 117, 117, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0,
|
||||
10, 10, 13, 13, 39, 39, 92, 92, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 48,
|
||||
57, 2, 0, 66, 66, 98, 98, 1, 0, 48, 49, 2, 0, 88, 88, 120, 120, 1, 0, 49,
|
||||
57, 1, 0, 48, 55, 3, 0, 48, 57, 65, 70, 97, 102, 2, 0, 69, 69, 101, 101,
|
||||
2, 0, 43, 43, 45, 45, 2, 0, 80, 80, 112, 112, 10, 0, 34, 34, 39, 39, 63,
|
||||
63, 92, 92, 97, 98, 102, 102, 110, 110, 114, 114, 116, 116, 118, 118, 2,
|
||||
0, 9, 9, 32, 32, 819, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0,
|
||||
0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0,
|
||||
0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1,
|
||||
0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29,
|
||||
1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0,
|
||||
37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0,
|
||||
0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0,
|
||||
0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0,
|
||||
0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1,
|
||||
0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75,
|
||||
1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0,
|
||||
83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 139, 1, 0, 0,
|
||||
0, 0, 141, 1, 0, 0, 0, 1, 143, 1, 0, 0, 0, 3, 145, 1, 0, 0, 0, 5, 147,
|
||||
1, 0, 0, 0, 7, 149, 1, 0, 0, 0, 9, 151, 1, 0, 0, 0, 11, 153, 1, 0, 0, 0,
|
||||
13, 155, 1, 0, 0, 0, 15, 158, 1, 0, 0, 0, 17, 160, 1, 0, 0, 0, 19, 163,
|
||||
1, 0, 0, 0, 21, 166, 1, 0, 0, 0, 23, 177, 1, 0, 0, 0, 25, 191, 1, 0, 0,
|
||||
0, 27, 220, 1, 0, 0, 0, 29, 222, 1, 0, 0, 0, 31, 224, 1, 0, 0, 0, 33, 226,
|
||||
1, 0, 0, 0, 35, 228, 1, 0, 0, 0, 37, 230, 1, 0, 0, 0, 39, 232, 1, 0, 0,
|
||||
0, 41, 235, 1, 0, 0, 0, 43, 238, 1, 0, 0, 0, 45, 241, 1, 0, 0, 0, 47, 243,
|
||||
1, 0, 0, 0, 49, 245, 1, 0, 0, 0, 51, 252, 1, 0, 0, 0, 53, 258, 1, 0, 0,
|
||||
0, 55, 260, 1, 0, 0, 0, 57, 266, 1, 0, 0, 0, 59, 272, 1, 0, 0, 0, 61, 274,
|
||||
1, 0, 0, 0, 63, 310, 1, 0, 0, 0, 65, 346, 1, 0, 0, 0, 67, 382, 1, 0, 0,
|
||||
0, 69, 412, 1, 0, 0, 0, 71, 450, 1, 0, 0, 0, 73, 488, 1, 0, 0, 0, 75, 514,
|
||||
1, 0, 0, 0, 77, 543, 1, 0, 0, 0, 79, 549, 1, 0, 0, 0, 81, 553, 1, 0, 0,
|
||||
0, 83, 568, 1, 0, 0, 0, 85, 571, 1, 0, 0, 0, 87, 585, 1, 0, 0, 0, 89, 600,
|
||||
1, 0, 0, 0, 91, 603, 1, 0, 0, 0, 93, 608, 1, 0, 0, 0, 95, 619, 1, 0, 0,
|
||||
0, 97, 628, 1, 0, 0, 0, 99, 630, 1, 0, 0, 0, 101, 632, 1, 0, 0, 0, 103,
|
||||
634, 1, 0, 0, 0, 105, 649, 1, 0, 0, 0, 107, 651, 1, 0, 0, 0, 109, 658,
|
||||
1, 0, 0, 0, 111, 662, 1, 0, 0, 0, 113, 664, 1, 0, 0, 0, 115, 666, 1, 0,
|
||||
0, 0, 117, 668, 1, 0, 0, 0, 119, 683, 1, 0, 0, 0, 121, 692, 1, 0, 0, 0,
|
||||
123, 694, 1, 0, 0, 0, 125, 710, 1, 0, 0, 0, 127, 712, 1, 0, 0, 0, 129,
|
||||
719, 1, 0, 0, 0, 131, 731, 1, 0, 0, 0, 133, 734, 1, 0, 0, 0, 135, 738,
|
||||
1, 0, 0, 0, 137, 759, 1, 0, 0, 0, 139, 762, 1, 0, 0, 0, 141, 773, 1, 0,
|
||||
0, 0, 143, 144, 5, 40, 0, 0, 144, 2, 1, 0, 0, 0, 145, 146, 5, 41, 0, 0,
|
||||
146, 4, 1, 0, 0, 0, 147, 148, 5, 91, 0, 0, 148, 6, 1, 0, 0, 0, 149, 150,
|
||||
5, 44, 0, 0, 150, 8, 1, 0, 0, 0, 151, 152, 5, 93, 0, 0, 152, 10, 1, 0,
|
||||
0, 0, 153, 154, 5, 60, 0, 0, 154, 12, 1, 0, 0, 0, 155, 156, 5, 60, 0, 0,
|
||||
156, 157, 5, 61, 0, 0, 157, 14, 1, 0, 0, 0, 158, 159, 5, 62, 0, 0, 159,
|
||||
16, 1, 0, 0, 0, 160, 161, 5, 62, 0, 0, 161, 162, 5, 61, 0, 0, 162, 18,
|
||||
1, 0, 0, 0, 163, 164, 5, 61, 0, 0, 164, 165, 5, 61, 0, 0, 165, 20, 1, 0,
|
||||
0, 0, 166, 167, 5, 33, 0, 0, 167, 168, 5, 61, 0, 0, 168, 22, 1, 0, 0, 0,
|
||||
169, 170, 5, 108, 0, 0, 170, 171, 5, 105, 0, 0, 171, 172, 5, 107, 0, 0,
|
||||
172, 178, 5, 101, 0, 0, 173, 174, 5, 76, 0, 0, 174, 175, 5, 73, 0, 0, 175,
|
||||
176, 5, 75, 0, 0, 176, 178, 5, 69, 0, 0, 177, 169, 1, 0, 0, 0, 177, 173,
|
||||
1, 0, 0, 0, 178, 24, 1, 0, 0, 0, 179, 180, 5, 101, 0, 0, 180, 181, 5, 120,
|
||||
0, 0, 181, 182, 5, 105, 0, 0, 182, 183, 5, 115, 0, 0, 183, 184, 5, 116,
|
||||
0, 0, 184, 192, 5, 115, 0, 0, 185, 186, 5, 69, 0, 0, 186, 187, 5, 88, 0,
|
||||
0, 187, 188, 5, 73, 0, 0, 188, 189, 5, 83, 0, 0, 189, 190, 5, 84, 0, 0,
|
||||
190, 192, 5, 83, 0, 0, 191, 179, 1, 0, 0, 0, 191, 185, 1, 0, 0, 0, 192,
|
||||
26, 1, 0, 0, 0, 193, 194, 5, 84, 0, 0, 194, 195, 5, 101, 0, 0, 195, 196,
|
||||
5, 120, 0, 0, 196, 197, 5, 116, 0, 0, 197, 198, 5, 77, 0, 0, 198, 199,
|
||||
5, 97, 0, 0, 199, 200, 5, 116, 0, 0, 200, 201, 5, 99, 0, 0, 201, 221, 5,
|
||||
104, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 101, 0, 0, 204, 205, 5,
|
||||
120, 0, 0, 205, 206, 5, 116, 0, 0, 206, 207, 5, 109, 0, 0, 207, 208, 5,
|
||||
97, 0, 0, 208, 209, 5, 116, 0, 0, 209, 210, 5, 99, 0, 0, 210, 221, 5, 104,
|
||||
0, 0, 211, 212, 5, 84, 0, 0, 212, 213, 5, 69, 0, 0, 213, 214, 5, 88, 0,
|
||||
0, 214, 215, 5, 84, 0, 0, 215, 216, 5, 77, 0, 0, 216, 217, 5, 65, 0, 0,
|
||||
217, 218, 5, 84, 0, 0, 218, 219, 5, 67, 0, 0, 219, 221, 5, 72, 0, 0, 220,
|
||||
193, 1, 0, 0, 0, 220, 202, 1, 0, 0, 0, 220, 211, 1, 0, 0, 0, 221, 28, 1,
|
||||
0, 0, 0, 222, 223, 5, 43, 0, 0, 223, 30, 1, 0, 0, 0, 224, 225, 5, 45, 0,
|
||||
0, 225, 32, 1, 0, 0, 0, 226, 227, 5, 42, 0, 0, 227, 34, 1, 0, 0, 0, 228,
|
||||
229, 5, 47, 0, 0, 229, 36, 1, 0, 0, 0, 230, 231, 5, 37, 0, 0, 231, 38,
|
||||
1, 0, 0, 0, 232, 233, 5, 42, 0, 0, 233, 234, 5, 42, 0, 0, 234, 40, 1, 0,
|
||||
0, 0, 235, 236, 5, 60, 0, 0, 236, 237, 5, 60, 0, 0, 237, 42, 1, 0, 0, 0,
|
||||
238, 239, 5, 62, 0, 0, 239, 240, 5, 62, 0, 0, 240, 44, 1, 0, 0, 0, 241,
|
||||
242, 5, 38, 0, 0, 242, 46, 1, 0, 0, 0, 243, 244, 5, 124, 0, 0, 244, 48,
|
||||
1, 0, 0, 0, 245, 246, 5, 94, 0, 0, 246, 50, 1, 0, 0, 0, 247, 248, 5, 38,
|
||||
0, 0, 248, 253, 5, 38, 0, 0, 249, 250, 5, 97, 0, 0, 250, 251, 5, 110, 0,
|
||||
0, 251, 253, 5, 100, 0, 0, 252, 247, 1, 0, 0, 0, 252, 249, 1, 0, 0, 0,
|
||||
253, 52, 1, 0, 0, 0, 254, 255, 5, 124, 0, 0, 255, 259, 5, 124, 0, 0, 256,
|
||||
257, 5, 111, 0, 0, 257, 259, 5, 114, 0, 0, 258, 254, 1, 0, 0, 0, 258, 256,
|
||||
1, 0, 0, 0, 259, 54, 1, 0, 0, 0, 260, 261, 5, 126, 0, 0, 261, 56, 1, 0,
|
||||
0, 0, 262, 267, 5, 33, 0, 0, 263, 264, 5, 110, 0, 0, 264, 265, 5, 111,
|
||||
0, 0, 265, 267, 5, 116, 0, 0, 266, 262, 1, 0, 0, 0, 266, 263, 1, 0, 0,
|
||||
0, 267, 58, 1, 0, 0, 0, 268, 269, 5, 105, 0, 0, 269, 273, 5, 110, 0, 0,
|
||||
270, 271, 5, 73, 0, 0, 271, 273, 5, 78, 0, 0, 272, 268, 1, 0, 0, 0, 272,
|
||||
270, 1, 0, 0, 0, 273, 60, 1, 0, 0, 0, 274, 279, 5, 91, 0, 0, 275, 278,
|
||||
3, 139, 69, 0, 276, 278, 3, 141, 70, 0, 277, 275, 1, 0, 0, 0, 277, 276,
|
||||
1, 0, 0, 0, 278, 281, 1, 0, 0, 0, 279, 277, 1, 0, 0, 0, 279, 280, 1, 0,
|
||||
0, 0, 280, 282, 1, 0, 0, 0, 281, 279, 1, 0, 0, 0, 282, 283, 5, 93, 0, 0,
|
||||
283, 62, 1, 0, 0, 0, 284, 285, 5, 106, 0, 0, 285, 286, 5, 115, 0, 0, 286,
|
||||
287, 5, 111, 0, 0, 287, 288, 5, 110, 0, 0, 288, 289, 5, 95, 0, 0, 289,
|
||||
290, 5, 99, 0, 0, 290, 291, 5, 111, 0, 0, 291, 292, 5, 110, 0, 0, 292,
|
||||
293, 5, 116, 0, 0, 293, 294, 5, 97, 0, 0, 294, 295, 5, 105, 0, 0, 295,
|
||||
296, 5, 110, 0, 0, 296, 311, 5, 115, 0, 0, 297, 298, 5, 74, 0, 0, 298,
|
||||
299, 5, 83, 0, 0, 299, 300, 5, 79, 0, 0, 300, 301, 5, 78, 0, 0, 301, 302,
|
||||
5, 95, 0, 0, 302, 303, 5, 67, 0, 0, 303, 304, 5, 79, 0, 0, 304, 305, 5,
|
||||
78, 0, 0, 305, 306, 5, 84, 0, 0, 306, 307, 5, 65, 0, 0, 307, 308, 5, 73,
|
||||
0, 0, 308, 309, 5, 78, 0, 0, 309, 311, 5, 83, 0, 0, 310, 284, 1, 0, 0,
|
||||
0, 310, 297, 1, 0, 0, 0, 311, 64, 1, 0, 0, 0, 312, 313, 5, 106, 0, 0, 313,
|
||||
314, 5, 115, 0, 0, 314, 315, 5, 111, 0, 0, 315, 316, 5, 110, 0, 0, 316,
|
||||
317, 5, 95, 0, 0, 317, 318, 5, 99, 0, 0, 318, 319, 5, 111, 0, 0, 319, 320,
|
||||
5, 110, 0, 0, 320, 321, 5, 116, 0, 0, 321, 322, 5, 97, 0, 0, 322, 323,
|
||||
5, 105, 0, 0, 323, 324, 5, 110, 0, 0, 324, 325, 5, 115, 0, 0, 325, 326,
|
||||
5, 95, 0, 0, 326, 327, 5, 97, 0, 0, 327, 328, 5, 108, 0, 0, 328, 347, 5,
|
||||
108, 0, 0, 329, 330, 5, 74, 0, 0, 330, 331, 5, 83, 0, 0, 331, 332, 5, 79,
|
||||
0, 0, 332, 333, 5, 78, 0, 0, 333, 334, 5, 95, 0, 0, 334, 335, 5, 67, 0,
|
||||
0, 335, 336, 5, 79, 0, 0, 336, 337, 5, 78, 0, 0, 337, 338, 5, 84, 0, 0,
|
||||
338, 339, 5, 65, 0, 0, 339, 340, 5, 73, 0, 0, 340, 341, 5, 78, 0, 0, 341,
|
||||
342, 5, 83, 0, 0, 342, 343, 5, 95, 0, 0, 343, 344, 5, 65, 0, 0, 344, 345,
|
||||
5, 76, 0, 0, 345, 347, 5, 76, 0, 0, 346, 312, 1, 0, 0, 0, 346, 329, 1,
|
||||
0, 0, 0, 347, 66, 1, 0, 0, 0, 348, 349, 5, 106, 0, 0, 349, 350, 5, 115,
|
||||
0, 0, 350, 351, 5, 111, 0, 0, 351, 352, 5, 110, 0, 0, 352, 353, 5, 95,
|
||||
0, 0, 353, 354, 5, 99, 0, 0, 354, 355, 5, 111, 0, 0, 355, 356, 5, 110,
|
||||
0, 0, 356, 357, 5, 116, 0, 0, 357, 358, 5, 97, 0, 0, 358, 359, 5, 105,
|
||||
0, 0, 359, 360, 5, 110, 0, 0, 360, 361, 5, 115, 0, 0, 361, 362, 5, 95,
|
||||
0, 0, 362, 363, 5, 97, 0, 0, 363, 364, 5, 110, 0, 0, 364, 383, 5, 121,
|
||||
0, 0, 365, 366, 5, 74, 0, 0, 366, 367, 5, 83, 0, 0, 367, 368, 5, 79, 0,
|
||||
0, 368, 369, 5, 78, 0, 0, 369, 370, 5, 95, 0, 0, 370, 371, 5, 67, 0, 0,
|
||||
371, 372, 5, 79, 0, 0, 372, 373, 5, 78, 0, 0, 373, 374, 5, 84, 0, 0, 374,
|
||||
375, 5, 65, 0, 0, 375, 376, 5, 73, 0, 0, 376, 377, 5, 78, 0, 0, 377, 378,
|
||||
5, 83, 0, 0, 378, 379, 5, 95, 0, 0, 379, 380, 5, 65, 0, 0, 380, 381, 5,
|
||||
78, 0, 0, 381, 383, 5, 89, 0, 0, 382, 348, 1, 0, 0, 0, 382, 365, 1, 0,
|
||||
0, 0, 383, 68, 1, 0, 0, 0, 384, 385, 5, 97, 0, 0, 385, 386, 5, 114, 0,
|
||||
0, 386, 387, 5, 114, 0, 0, 387, 388, 5, 97, 0, 0, 388, 389, 5, 121, 0,
|
||||
0, 389, 390, 5, 95, 0, 0, 390, 391, 5, 99, 0, 0, 391, 392, 5, 111, 0, 0,
|
||||
392, 393, 5, 110, 0, 0, 393, 394, 5, 116, 0, 0, 394, 395, 5, 97, 0, 0,
|
||||
395, 396, 5, 105, 0, 0, 396, 397, 5, 110, 0, 0, 397, 413, 5, 115, 0, 0,
|
||||
398, 399, 5, 65, 0, 0, 399, 400, 5, 82, 0, 0, 400, 401, 5, 82, 0, 0, 401,
|
||||
402, 5, 65, 0, 0, 402, 403, 5, 89, 0, 0, 403, 404, 5, 95, 0, 0, 404, 405,
|
||||
5, 67, 0, 0, 405, 406, 5, 79, 0, 0, 406, 407, 5, 78, 0, 0, 407, 408, 5,
|
||||
84, 0, 0, 408, 409, 5, 65, 0, 0, 409, 410, 5, 73, 0, 0, 410, 411, 5, 78,
|
||||
0, 0, 411, 413, 5, 83, 0, 0, 412, 384, 1, 0, 0, 0, 412, 398, 1, 0, 0, 0,
|
||||
413, 70, 1, 0, 0, 0, 414, 415, 5, 97, 0, 0, 415, 416, 5, 114, 0, 0, 416,
|
||||
417, 5, 114, 0, 0, 417, 418, 5, 97, 0, 0, 418, 419, 5, 121, 0, 0, 419,
|
||||
420, 5, 95, 0, 0, 420, 421, 5, 99, 0, 0, 421, 422, 5, 111, 0, 0, 422, 423,
|
||||
5, 110, 0, 0, 423, 424, 5, 116, 0, 0, 424, 425, 5, 97, 0, 0, 425, 426,
|
||||
5, 105, 0, 0, 426, 427, 5, 110, 0, 0, 427, 428, 5, 115, 0, 0, 428, 429,
|
||||
5, 95, 0, 0, 429, 430, 5, 97, 0, 0, 430, 431, 5, 108, 0, 0, 431, 451, 5,
|
||||
108, 0, 0, 432, 433, 5, 65, 0, 0, 433, 434, 5, 82, 0, 0, 434, 435, 5, 82,
|
||||
0, 0, 435, 436, 5, 65, 0, 0, 436, 437, 5, 89, 0, 0, 437, 438, 5, 95, 0,
|
||||
0, 438, 439, 5, 67, 0, 0, 439, 440, 5, 79, 0, 0, 440, 441, 5, 78, 0, 0,
|
||||
441, 442, 5, 84, 0, 0, 442, 443, 5, 65, 0, 0, 443, 444, 5, 73, 0, 0, 444,
|
||||
445, 5, 78, 0, 0, 445, 446, 5, 83, 0, 0, 446, 447, 5, 95, 0, 0, 447, 448,
|
||||
5, 65, 0, 0, 448, 449, 5, 76, 0, 0, 449, 451, 5, 76, 0, 0, 450, 414, 1,
|
||||
0, 0, 0, 450, 432, 1, 0, 0, 0, 451, 72, 1, 0, 0, 0, 452, 453, 5, 97, 0,
|
||||
0, 453, 454, 5, 114, 0, 0, 454, 455, 5, 114, 0, 0, 455, 456, 5, 97, 0,
|
||||
0, 456, 457, 5, 121, 0, 0, 457, 458, 5, 95, 0, 0, 458, 459, 5, 99, 0, 0,
|
||||
459, 460, 5, 111, 0, 0, 460, 461, 5, 110, 0, 0, 461, 462, 5, 116, 0, 0,
|
||||
462, 463, 5, 97, 0, 0, 463, 464, 5, 105, 0, 0, 464, 465, 5, 110, 0, 0,
|
||||
465, 466, 5, 115, 0, 0, 466, 467, 5, 95, 0, 0, 467, 468, 5, 97, 0, 0, 468,
|
||||
469, 5, 110, 0, 0, 469, 489, 5, 121, 0, 0, 470, 471, 5, 65, 0, 0, 471,
|
||||
472, 5, 82, 0, 0, 472, 473, 5, 82, 0, 0, 473, 474, 5, 65, 0, 0, 474, 475,
|
||||
5, 89, 0, 0, 475, 476, 5, 95, 0, 0, 476, 477, 5, 67, 0, 0, 477, 478, 5,
|
||||
79, 0, 0, 478, 479, 5, 78, 0, 0, 479, 480, 5, 84, 0, 0, 480, 481, 5, 65,
|
||||
0, 0, 481, 482, 5, 73, 0, 0, 482, 483, 5, 78, 0, 0, 483, 484, 5, 83, 0,
|
||||
0, 484, 485, 5, 95, 0, 0, 485, 486, 5, 65, 0, 0, 486, 487, 5, 78, 0, 0,
|
||||
487, 489, 5, 89, 0, 0, 488, 452, 1, 0, 0, 0, 488, 470, 1, 0, 0, 0, 489,
|
||||
74, 1, 0, 0, 0, 490, 491, 5, 97, 0, 0, 491, 492, 5, 114, 0, 0, 492, 493,
|
||||
5, 114, 0, 0, 493, 494, 5, 97, 0, 0, 494, 495, 5, 121, 0, 0, 495, 496,
|
||||
5, 95, 0, 0, 496, 497, 5, 108, 0, 0, 497, 498, 5, 101, 0, 0, 498, 499,
|
||||
5, 110, 0, 0, 499, 500, 5, 103, 0, 0, 500, 501, 5, 116, 0, 0, 501, 515,
|
||||
5, 104, 0, 0, 502, 503, 5, 65, 0, 0, 503, 504, 5, 82, 0, 0, 504, 505, 5,
|
||||
82, 0, 0, 505, 506, 5, 65, 0, 0, 506, 507, 5, 89, 0, 0, 507, 508, 5, 95,
|
||||
0, 0, 508, 509, 5, 76, 0, 0, 509, 510, 5, 69, 0, 0, 510, 511, 5, 78, 0,
|
||||
0, 511, 512, 5, 71, 0, 0, 512, 513, 5, 84, 0, 0, 513, 515, 5, 72, 0, 0,
|
||||
514, 490, 1, 0, 0, 0, 514, 502, 1, 0, 0, 0, 515, 76, 1, 0, 0, 0, 516, 517,
|
||||
5, 116, 0, 0, 517, 518, 5, 114, 0, 0, 518, 519, 5, 117, 0, 0, 519, 544,
|
||||
5, 101, 0, 0, 520, 521, 5, 84, 0, 0, 521, 522, 5, 114, 0, 0, 522, 523,
|
||||
5, 117, 0, 0, 523, 544, 5, 101, 0, 0, 524, 525, 5, 84, 0, 0, 525, 526,
|
||||
5, 82, 0, 0, 526, 527, 5, 85, 0, 0, 527, 544, 5, 69, 0, 0, 528, 529, 5,
|
||||
102, 0, 0, 529, 530, 5, 97, 0, 0, 530, 531, 5, 108, 0, 0, 531, 532, 5,
|
||||
115, 0, 0, 532, 544, 5, 101, 0, 0, 533, 534, 5, 70, 0, 0, 534, 535, 5,
|
||||
97, 0, 0, 535, 536, 5, 108, 0, 0, 536, 537, 5, 115, 0, 0, 537, 544, 5,
|
||||
101, 0, 0, 538, 539, 5, 70, 0, 0, 539, 540, 5, 65, 0, 0, 540, 541, 5, 76,
|
||||
0, 0, 541, 542, 5, 83, 0, 0, 542, 544, 5, 69, 0, 0, 543, 516, 1, 0, 0,
|
||||
0, 543, 520, 1, 0, 0, 0, 543, 524, 1, 0, 0, 0, 543, 528, 1, 0, 0, 0, 543,
|
||||
533, 1, 0, 0, 0, 543, 538, 1, 0, 0, 0, 544, 78, 1, 0, 0, 0, 545, 550, 3,
|
||||
105, 52, 0, 546, 550, 3, 107, 53, 0, 547, 550, 3, 109, 54, 0, 548, 550,
|
||||
3, 103, 51, 0, 549, 545, 1, 0, 0, 0, 549, 546, 1, 0, 0, 0, 549, 547, 1,
|
||||
0, 0, 0, 549, 548, 1, 0, 0, 0, 550, 80, 1, 0, 0, 0, 551, 554, 3, 121, 60,
|
||||
0, 552, 554, 3, 123, 61, 0, 553, 551, 1, 0, 0, 0, 553, 552, 1, 0, 0, 0,
|
||||
554, 82, 1, 0, 0, 0, 555, 560, 3, 99, 49, 0, 556, 559, 3, 99, 49, 0, 557,
|
||||
559, 3, 101, 50, 0, 558, 556, 1, 0, 0, 0, 558, 557, 1, 0, 0, 0, 559, 562,
|
||||
1, 0, 0, 0, 560, 558, 1, 0, 0, 0, 560, 561, 1, 0, 0, 0, 561, 569, 1, 0,
|
||||
0, 0, 562, 560, 1, 0, 0, 0, 563, 564, 5, 36, 0, 0, 564, 565, 5, 109, 0,
|
||||
0, 565, 566, 5, 101, 0, 0, 566, 567, 5, 116, 0, 0, 567, 569, 5, 97, 0,
|
||||
0, 568, 555, 1, 0, 0, 0, 568, 563, 1, 0, 0, 0, 569, 84, 1, 0, 0, 0, 570,
|
||||
572, 3, 89, 44, 0, 571, 570, 1, 0, 0, 0, 571, 572, 1, 0, 0, 0, 572, 583,
|
||||
1, 0, 0, 0, 573, 575, 5, 34, 0, 0, 574, 576, 3, 91, 45, 0, 575, 574, 1,
|
||||
0, 0, 0, 575, 576, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 584, 5, 34, 0,
|
||||
0, 578, 580, 5, 39, 0, 0, 579, 581, 3, 93, 46, 0, 580, 579, 1, 0, 0, 0,
|
||||
580, 581, 1, 0, 0, 0, 581, 582, 1, 0, 0, 0, 582, 584, 5, 39, 0, 0, 583,
|
||||
573, 1, 0, 0, 0, 583, 578, 1, 0, 0, 0, 584, 86, 1, 0, 0, 0, 585, 593, 3,
|
||||
83, 41, 0, 586, 589, 5, 91, 0, 0, 587, 590, 3, 85, 42, 0, 588, 590, 3,
|
||||
105, 52, 0, 589, 587, 1, 0, 0, 0, 589, 588, 1, 0, 0, 0, 590, 591, 1, 0,
|
||||
0, 0, 591, 592, 5, 93, 0, 0, 592, 594, 1, 0, 0, 0, 593, 586, 1, 0, 0, 0,
|
||||
594, 595, 1, 0, 0, 0, 595, 593, 1, 0, 0, 0, 595, 596, 1, 0, 0, 0, 596,
|
||||
88, 1, 0, 0, 0, 597, 598, 5, 117, 0, 0, 598, 601, 5, 56, 0, 0, 599, 601,
|
||||
7, 0, 0, 0, 600, 597, 1, 0, 0, 0, 600, 599, 1, 0, 0, 0, 601, 90, 1, 0,
|
||||
0, 0, 602, 604, 3, 95, 47, 0, 603, 602, 1, 0, 0, 0, 604, 605, 1, 0, 0,
|
||||
0, 605, 603, 1, 0, 0, 0, 605, 606, 1, 0, 0, 0, 606, 92, 1, 0, 0, 0, 607,
|
||||
609, 3, 97, 48, 0, 608, 607, 1, 0, 0, 0, 609, 610, 1, 0, 0, 0, 610, 608,
|
||||
1, 0, 0, 0, 610, 611, 1, 0, 0, 0, 611, 94, 1, 0, 0, 0, 612, 620, 8, 1,
|
||||
0, 0, 613, 620, 3, 137, 68, 0, 614, 615, 5, 92, 0, 0, 615, 620, 5, 10,
|
||||
0, 0, 616, 617, 5, 92, 0, 0, 617, 618, 5, 13, 0, 0, 618, 620, 5, 10, 0,
|
||||
0, 619, 612, 1, 0, 0, 0, 619, 613, 1, 0, 0, 0, 619, 614, 1, 0, 0, 0, 619,
|
||||
616, 1, 0, 0, 0, 620, 96, 1, 0, 0, 0, 621, 629, 8, 2, 0, 0, 622, 629, 3,
|
||||
137, 68, 0, 623, 624, 5, 92, 0, 0, 624, 629, 5, 10, 0, 0, 625, 626, 5,
|
||||
92, 0, 0, 626, 627, 5, 13, 0, 0, 627, 629, 5, 10, 0, 0, 628, 621, 1, 0,
|
||||
0, 0, 628, 622, 1, 0, 0, 0, 628, 623, 1, 0, 0, 0, 628, 625, 1, 0, 0, 0,
|
||||
629, 98, 1, 0, 0, 0, 630, 631, 7, 3, 0, 0, 631, 100, 1, 0, 0, 0, 632, 633,
|
||||
7, 4, 0, 0, 633, 102, 1, 0, 0, 0, 634, 635, 5, 48, 0, 0, 635, 637, 7, 5,
|
||||
0, 0, 636, 638, 7, 6, 0, 0, 637, 636, 1, 0, 0, 0, 638, 639, 1, 0, 0, 0,
|
||||
639, 637, 1, 0, 0, 0, 639, 640, 1, 0, 0, 0, 640, 104, 1, 0, 0, 0, 641,
|
||||
645, 3, 111, 55, 0, 642, 644, 3, 101, 50, 0, 643, 642, 1, 0, 0, 0, 644,
|
||||
647, 1, 0, 0, 0, 645, 643, 1, 0, 0, 0, 645, 646, 1, 0, 0, 0, 646, 650,
|
||||
1, 0, 0, 0, 647, 645, 1, 0, 0, 0, 648, 650, 5, 48, 0, 0, 649, 641, 1, 0,
|
||||
0, 0, 649, 648, 1, 0, 0, 0, 650, 106, 1, 0, 0, 0, 651, 655, 5, 48, 0, 0,
|
||||
652, 654, 3, 113, 56, 0, 653, 652, 1, 0, 0, 0, 654, 657, 1, 0, 0, 0, 655,
|
||||
653, 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, 656, 108, 1, 0, 0, 0, 657, 655,
|
||||
1, 0, 0, 0, 658, 659, 5, 48, 0, 0, 659, 660, 7, 7, 0, 0, 660, 661, 3, 133,
|
||||
66, 0, 661, 110, 1, 0, 0, 0, 662, 663, 7, 8, 0, 0, 663, 112, 1, 0, 0, 0,
|
||||
664, 665, 7, 9, 0, 0, 665, 114, 1, 0, 0, 0, 666, 667, 7, 10, 0, 0, 667,
|
||||
116, 1, 0, 0, 0, 668, 669, 3, 115, 57, 0, 669, 670, 3, 115, 57, 0, 670,
|
||||
671, 3, 115, 57, 0, 671, 672, 3, 115, 57, 0, 672, 118, 1, 0, 0, 0, 673,
|
||||
674, 5, 92, 0, 0, 674, 675, 5, 117, 0, 0, 675, 676, 1, 0, 0, 0, 676, 684,
|
||||
3, 117, 58, 0, 677, 678, 5, 92, 0, 0, 678, 679, 5, 85, 0, 0, 679, 680,
|
||||
1, 0, 0, 0, 680, 681, 3, 117, 58, 0, 681, 682, 3, 117, 58, 0, 682, 684,
|
||||
1, 0, 0, 0, 683, 673, 1, 0, 0, 0, 683, 677, 1, 0, 0, 0, 684, 120, 1, 0,
|
||||
0, 0, 685, 687, 3, 125, 62, 0, 686, 688, 3, 127, 63, 0, 687, 686, 1, 0,
|
||||
0, 0, 687, 688, 1, 0, 0, 0, 688, 693, 1, 0, 0, 0, 689, 690, 3, 129, 64,
|
||||
0, 690, 691, 3, 127, 63, 0, 691, 693, 1, 0, 0, 0, 692, 685, 1, 0, 0, 0,
|
||||
692, 689, 1, 0, 0, 0, 693, 122, 1, 0, 0, 0, 694, 695, 5, 48, 0, 0, 695,
|
||||
698, 7, 7, 0, 0, 696, 699, 3, 131, 65, 0, 697, 699, 3, 133, 66, 0, 698,
|
||||
696, 1, 0, 0, 0, 698, 697, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 701,
|
||||
3, 135, 67, 0, 701, 124, 1, 0, 0, 0, 702, 704, 3, 129, 64, 0, 703, 702,
|
||||
1, 0, 0, 0, 703, 704, 1, 0, 0, 0, 704, 705, 1, 0, 0, 0, 705, 706, 5, 46,
|
||||
0, 0, 706, 711, 3, 129, 64, 0, 707, 708, 3, 129, 64, 0, 708, 709, 5, 46,
|
||||
0, 0, 709, 711, 1, 0, 0, 0, 710, 703, 1, 0, 0, 0, 710, 707, 1, 0, 0, 0,
|
||||
711, 126, 1, 0, 0, 0, 712, 714, 7, 11, 0, 0, 713, 715, 7, 12, 0, 0, 714,
|
||||
713, 1, 0, 0, 0, 714, 715, 1, 0, 0, 0, 715, 716, 1, 0, 0, 0, 716, 717,
|
||||
3, 129, 64, 0, 717, 128, 1, 0, 0, 0, 718, 720, 3, 101, 50, 0, 719, 718,
|
||||
1, 0, 0, 0, 720, 721, 1, 0, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0,
|
||||
0, 0, 722, 130, 1, 0, 0, 0, 723, 725, 3, 133, 66, 0, 724, 723, 1, 0, 0,
|
||||
0, 724, 725, 1, 0, 0, 0, 725, 726, 1, 0, 0, 0, 726, 727, 5, 46, 0, 0, 727,
|
||||
732, 3, 133, 66, 0, 728, 729, 3, 133, 66, 0, 729, 730, 5, 46, 0, 0, 730,
|
||||
732, 1, 0, 0, 0, 731, 724, 1, 0, 0, 0, 731, 728, 1, 0, 0, 0, 732, 132,
|
||||
1, 0, 0, 0, 733, 735, 3, 115, 57, 0, 734, 733, 1, 0, 0, 0, 735, 736, 1,
|
||||
0, 0, 0, 736, 734, 1, 0, 0, 0, 736, 737, 1, 0, 0, 0, 737, 134, 1, 0, 0,
|
||||
0, 738, 740, 7, 13, 0, 0, 739, 741, 7, 12, 0, 0, 740, 739, 1, 0, 0, 0,
|
||||
740, 741, 1, 0, 0, 0, 741, 742, 1, 0, 0, 0, 742, 743, 3, 129, 64, 0, 743,
|
||||
136, 1, 0, 0, 0, 744, 745, 5, 92, 0, 0, 745, 760, 7, 14, 0, 0, 746, 747,
|
||||
5, 92, 0, 0, 747, 749, 3, 113, 56, 0, 748, 750, 3, 113, 56, 0, 749, 748,
|
||||
1, 0, 0, 0, 749, 750, 1, 0, 0, 0, 750, 752, 1, 0, 0, 0, 751, 753, 3, 113,
|
||||
56, 0, 752, 751, 1, 0, 0, 0, 752, 753, 1, 0, 0, 0, 753, 760, 1, 0, 0, 0,
|
||||
754, 755, 5, 92, 0, 0, 755, 756, 5, 120, 0, 0, 756, 757, 1, 0, 0, 0, 757,
|
||||
760, 3, 133, 66, 0, 758, 760, 3, 119, 59, 0, 759, 744, 1, 0, 0, 0, 759,
|
||||
746, 1, 0, 0, 0, 759, 754, 1, 0, 0, 0, 759, 758, 1, 0, 0, 0, 760, 138,
|
||||
1, 0, 0, 0, 761, 763, 7, 15, 0, 0, 762, 761, 1, 0, 0, 0, 763, 764, 1, 0,
|
||||
0, 0, 764, 762, 1, 0, 0, 0, 764, 765, 1, 0, 0, 0, 765, 766, 1, 0, 0, 0,
|
||||
766, 767, 6, 69, 0, 0, 767, 140, 1, 0, 0, 0, 768, 770, 5, 13, 0, 0, 769,
|
||||
771, 5, 10, 0, 0, 770, 769, 1, 0, 0, 0, 770, 771, 1, 0, 0, 0, 771, 774,
|
||||
1, 0, 0, 0, 772, 774, 5, 10, 0, 0, 773, 768, 1, 0, 0, 0, 773, 772, 1, 0,
|
||||
0, 0, 774, 775, 1, 0, 0, 0, 775, 776, 6, 70, 0, 0, 776, 142, 1, 0, 0, 0,
|
||||
56, 0, 177, 191, 220, 252, 258, 266, 272, 277, 279, 310, 346, 382, 412,
|
||||
450, 488, 514, 543, 549, 553, 558, 560, 568, 571, 575, 580, 583, 589, 595,
|
||||
600, 605, 610, 619, 628, 639, 645, 649, 655, 683, 687, 692, 698, 703, 710,
|
||||
714, 721, 724, 731, 736, 740, 749, 752, 759, 764, 770, 773, 1, 6, 0, 0,
|
||||
38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38,
|
||||
1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 499, 8, 38, 1, 39, 1, 39, 1, 39, 1,
|
||||
39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39,
|
||||
1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 3,
|
||||
39, 525, 8, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40,
|
||||
1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1,
|
||||
40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 3, 40, 554,
|
||||
8, 40, 1, 41, 1, 41, 1, 41, 1, 41, 3, 41, 560, 8, 41, 1, 42, 1, 42, 3,
|
||||
42, 564, 8, 42, 1, 43, 1, 43, 1, 43, 5, 43, 569, 8, 43, 10, 43, 12, 43,
|
||||
572, 9, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 3, 45, 581,
|
||||
8, 45, 1, 45, 1, 45, 3, 45, 585, 8, 45, 1, 45, 1, 45, 1, 45, 3, 45, 590,
|
||||
8, 45, 1, 45, 3, 45, 593, 8, 45, 1, 46, 1, 46, 3, 46, 597, 8, 46, 1, 46,
|
||||
1, 46, 1, 46, 3, 46, 602, 8, 46, 1, 46, 1, 46, 4, 46, 606, 8, 46, 11, 46,
|
||||
12, 46, 607, 1, 47, 1, 47, 1, 47, 3, 47, 613, 8, 47, 1, 48, 4, 48, 616,
|
||||
8, 48, 11, 48, 12, 48, 617, 1, 49, 4, 49, 621, 8, 49, 11, 49, 12, 49, 622,
|
||||
1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 3, 50, 632, 8, 50, 1,
|
||||
51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, 641, 8, 51, 1, 52,
|
||||
1, 52, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 4, 54, 650, 8, 54, 11, 54, 12,
|
||||
54, 651, 1, 55, 1, 55, 5, 55, 656, 8, 55, 10, 55, 12, 55, 659, 9, 55, 1,
|
||||
55, 3, 55, 662, 8, 55, 1, 56, 1, 56, 5, 56, 666, 8, 56, 10, 56, 12, 56,
|
||||
669, 9, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 59, 1, 59, 1,
|
||||
60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62,
|
||||
1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 3, 62, 696, 8, 62, 1, 63, 1,
|
||||
63, 3, 63, 700, 8, 63, 1, 63, 1, 63, 1, 63, 3, 63, 705, 8, 63, 1, 64, 1,
|
||||
64, 1, 64, 1, 64, 3, 64, 711, 8, 64, 1, 64, 1, 64, 1, 65, 3, 65, 716, 8,
|
||||
65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 3, 65, 723, 8, 65, 1, 66, 1, 66,
|
||||
3, 66, 727, 8, 66, 1, 66, 1, 66, 1, 67, 4, 67, 732, 8, 67, 11, 67, 12,
|
||||
67, 733, 1, 68, 3, 68, 737, 8, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 3,
|
||||
68, 744, 8, 68, 1, 69, 4, 69, 747, 8, 69, 11, 69, 12, 69, 748, 1, 70, 1,
|
||||
70, 3, 70, 753, 8, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71,
|
||||
3, 71, 762, 8, 71, 1, 71, 3, 71, 765, 8, 71, 1, 71, 1, 71, 1, 71, 1, 71,
|
||||
1, 71, 3, 71, 772, 8, 71, 1, 72, 4, 72, 775, 8, 72, 11, 72, 12, 72, 776,
|
||||
1, 72, 1, 72, 1, 73, 1, 73, 3, 73, 783, 8, 73, 1, 73, 3, 73, 786, 8, 73,
|
||||
1, 73, 1, 73, 0, 0, 74, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15,
|
||||
8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17,
|
||||
35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26,
|
||||
53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35,
|
||||
71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44,
|
||||
89, 45, 91, 46, 93, 47, 95, 0, 97, 0, 99, 0, 101, 0, 103, 0, 105, 0, 107,
|
||||
0, 109, 0, 111, 0, 113, 0, 115, 0, 117, 0, 119, 0, 121, 0, 123, 0, 125,
|
||||
0, 127, 0, 129, 0, 131, 0, 133, 0, 135, 0, 137, 0, 139, 0, 141, 0, 143,
|
||||
0, 145, 48, 147, 49, 1, 0, 16, 3, 0, 76, 76, 85, 85, 117, 117, 4, 0, 10,
|
||||
10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92, 92, 3, 0,
|
||||
65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 66, 66, 98, 98, 1, 0, 48,
|
||||
49, 2, 0, 88, 88, 120, 120, 1, 0, 49, 57, 1, 0, 48, 55, 3, 0, 48, 57, 65,
|
||||
70, 97, 102, 2, 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 2, 0, 80, 80,
|
||||
112, 112, 10, 0, 34, 34, 39, 39, 63, 63, 92, 92, 97, 98, 102, 102, 110,
|
||||
110, 114, 114, 116, 116, 118, 118, 2, 0, 9, 9, 32, 32, 831, 0, 1, 1, 0,
|
||||
0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0,
|
||||
0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1,
|
||||
0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25,
|
||||
1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0,
|
||||
33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0,
|
||||
0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0,
|
||||
0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0,
|
||||
0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1,
|
||||
0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71,
|
||||
1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0,
|
||||
79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0,
|
||||
0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0,
|
||||
0, 0, 145, 1, 0, 0, 0, 0, 147, 1, 0, 0, 0, 1, 149, 1, 0, 0, 0, 3, 151,
|
||||
1, 0, 0, 0, 5, 153, 1, 0, 0, 0, 7, 155, 1, 0, 0, 0, 9, 157, 1, 0, 0, 0,
|
||||
11, 159, 1, 0, 0, 0, 13, 161, 1, 0, 0, 0, 15, 163, 1, 0, 0, 0, 17, 165,
|
||||
1, 0, 0, 0, 19, 168, 1, 0, 0, 0, 21, 170, 1, 0, 0, 0, 23, 173, 1, 0, 0,
|
||||
0, 25, 176, 1, 0, 0, 0, 27, 187, 1, 0, 0, 0, 29, 201, 1, 0, 0, 0, 31, 230,
|
||||
1, 0, 0, 0, 33, 232, 1, 0, 0, 0, 35, 234, 1, 0, 0, 0, 37, 236, 1, 0, 0,
|
||||
0, 39, 238, 1, 0, 0, 0, 41, 240, 1, 0, 0, 0, 43, 242, 1, 0, 0, 0, 45, 245,
|
||||
1, 0, 0, 0, 47, 248, 1, 0, 0, 0, 49, 251, 1, 0, 0, 0, 51, 253, 1, 0, 0,
|
||||
0, 53, 255, 1, 0, 0, 0, 55, 262, 1, 0, 0, 0, 57, 268, 1, 0, 0, 0, 59, 270,
|
||||
1, 0, 0, 0, 61, 276, 1, 0, 0, 0, 63, 282, 1, 0, 0, 0, 65, 284, 1, 0, 0,
|
||||
0, 67, 320, 1, 0, 0, 0, 69, 356, 1, 0, 0, 0, 71, 392, 1, 0, 0, 0, 73, 422,
|
||||
1, 0, 0, 0, 75, 460, 1, 0, 0, 0, 77, 498, 1, 0, 0, 0, 79, 524, 1, 0, 0,
|
||||
0, 81, 553, 1, 0, 0, 0, 83, 559, 1, 0, 0, 0, 85, 563, 1, 0, 0, 0, 87, 565,
|
||||
1, 0, 0, 0, 89, 573, 1, 0, 0, 0, 91, 580, 1, 0, 0, 0, 93, 596, 1, 0, 0,
|
||||
0, 95, 612, 1, 0, 0, 0, 97, 615, 1, 0, 0, 0, 99, 620, 1, 0, 0, 0, 101,
|
||||
631, 1, 0, 0, 0, 103, 640, 1, 0, 0, 0, 105, 642, 1, 0, 0, 0, 107, 644,
|
||||
1, 0, 0, 0, 109, 646, 1, 0, 0, 0, 111, 661, 1, 0, 0, 0, 113, 663, 1, 0,
|
||||
0, 0, 115, 670, 1, 0, 0, 0, 117, 674, 1, 0, 0, 0, 119, 676, 1, 0, 0, 0,
|
||||
121, 678, 1, 0, 0, 0, 123, 680, 1, 0, 0, 0, 125, 695, 1, 0, 0, 0, 127,
|
||||
704, 1, 0, 0, 0, 129, 706, 1, 0, 0, 0, 131, 722, 1, 0, 0, 0, 133, 724,
|
||||
1, 0, 0, 0, 135, 731, 1, 0, 0, 0, 137, 743, 1, 0, 0, 0, 139, 746, 1, 0,
|
||||
0, 0, 141, 750, 1, 0, 0, 0, 143, 771, 1, 0, 0, 0, 145, 774, 1, 0, 0, 0,
|
||||
147, 785, 1, 0, 0, 0, 149, 150, 5, 40, 0, 0, 150, 2, 1, 0, 0, 0, 151, 152,
|
||||
5, 41, 0, 0, 152, 4, 1, 0, 0, 0, 153, 154, 5, 91, 0, 0, 154, 6, 1, 0, 0,
|
||||
0, 155, 156, 5, 44, 0, 0, 156, 8, 1, 0, 0, 0, 157, 158, 5, 93, 0, 0, 158,
|
||||
10, 1, 0, 0, 0, 159, 160, 5, 123, 0, 0, 160, 12, 1, 0, 0, 0, 161, 162,
|
||||
5, 125, 0, 0, 162, 14, 1, 0, 0, 0, 163, 164, 5, 60, 0, 0, 164, 16, 1, 0,
|
||||
0, 0, 165, 166, 5, 60, 0, 0, 166, 167, 5, 61, 0, 0, 167, 18, 1, 0, 0, 0,
|
||||
168, 169, 5, 62, 0, 0, 169, 20, 1, 0, 0, 0, 170, 171, 5, 62, 0, 0, 171,
|
||||
172, 5, 61, 0, 0, 172, 22, 1, 0, 0, 0, 173, 174, 5, 61, 0, 0, 174, 175,
|
||||
5, 61, 0, 0, 175, 24, 1, 0, 0, 0, 176, 177, 5, 33, 0, 0, 177, 178, 5, 61,
|
||||
0, 0, 178, 26, 1, 0, 0, 0, 179, 180, 5, 108, 0, 0, 180, 181, 5, 105, 0,
|
||||
0, 181, 182, 5, 107, 0, 0, 182, 188, 5, 101, 0, 0, 183, 184, 5, 76, 0,
|
||||
0, 184, 185, 5, 73, 0, 0, 185, 186, 5, 75, 0, 0, 186, 188, 5, 69, 0, 0,
|
||||
187, 179, 1, 0, 0, 0, 187, 183, 1, 0, 0, 0, 188, 28, 1, 0, 0, 0, 189, 190,
|
||||
5, 101, 0, 0, 190, 191, 5, 120, 0, 0, 191, 192, 5, 105, 0, 0, 192, 193,
|
||||
5, 115, 0, 0, 193, 194, 5, 116, 0, 0, 194, 202, 5, 115, 0, 0, 195, 196,
|
||||
5, 69, 0, 0, 196, 197, 5, 88, 0, 0, 197, 198, 5, 73, 0, 0, 198, 199, 5,
|
||||
83, 0, 0, 199, 200, 5, 84, 0, 0, 200, 202, 5, 83, 0, 0, 201, 189, 1, 0,
|
||||
0, 0, 201, 195, 1, 0, 0, 0, 202, 30, 1, 0, 0, 0, 203, 204, 5, 84, 0, 0,
|
||||
204, 205, 5, 101, 0, 0, 205, 206, 5, 120, 0, 0, 206, 207, 5, 116, 0, 0,
|
||||
207, 208, 5, 77, 0, 0, 208, 209, 5, 97, 0, 0, 209, 210, 5, 116, 0, 0, 210,
|
||||
211, 5, 99, 0, 0, 211, 231, 5, 104, 0, 0, 212, 213, 5, 116, 0, 0, 213,
|
||||
214, 5, 101, 0, 0, 214, 215, 5, 120, 0, 0, 215, 216, 5, 116, 0, 0, 216,
|
||||
217, 5, 109, 0, 0, 217, 218, 5, 97, 0, 0, 218, 219, 5, 116, 0, 0, 219,
|
||||
220, 5, 99, 0, 0, 220, 231, 5, 104, 0, 0, 221, 222, 5, 84, 0, 0, 222, 223,
|
||||
5, 69, 0, 0, 223, 224, 5, 88, 0, 0, 224, 225, 5, 84, 0, 0, 225, 226, 5,
|
||||
77, 0, 0, 226, 227, 5, 65, 0, 0, 227, 228, 5, 84, 0, 0, 228, 229, 5, 67,
|
||||
0, 0, 229, 231, 5, 72, 0, 0, 230, 203, 1, 0, 0, 0, 230, 212, 1, 0, 0, 0,
|
||||
230, 221, 1, 0, 0, 0, 231, 32, 1, 0, 0, 0, 232, 233, 5, 43, 0, 0, 233,
|
||||
34, 1, 0, 0, 0, 234, 235, 5, 45, 0, 0, 235, 36, 1, 0, 0, 0, 236, 237, 5,
|
||||
42, 0, 0, 237, 38, 1, 0, 0, 0, 238, 239, 5, 47, 0, 0, 239, 40, 1, 0, 0,
|
||||
0, 240, 241, 5, 37, 0, 0, 241, 42, 1, 0, 0, 0, 242, 243, 5, 42, 0, 0, 243,
|
||||
244, 5, 42, 0, 0, 244, 44, 1, 0, 0, 0, 245, 246, 5, 60, 0, 0, 246, 247,
|
||||
5, 60, 0, 0, 247, 46, 1, 0, 0, 0, 248, 249, 5, 62, 0, 0, 249, 250, 5, 62,
|
||||
0, 0, 250, 48, 1, 0, 0, 0, 251, 252, 5, 38, 0, 0, 252, 50, 1, 0, 0, 0,
|
||||
253, 254, 5, 124, 0, 0, 254, 52, 1, 0, 0, 0, 255, 256, 5, 94, 0, 0, 256,
|
||||
54, 1, 0, 0, 0, 257, 258, 5, 38, 0, 0, 258, 263, 5, 38, 0, 0, 259, 260,
|
||||
5, 97, 0, 0, 260, 261, 5, 110, 0, 0, 261, 263, 5, 100, 0, 0, 262, 257,
|
||||
1, 0, 0, 0, 262, 259, 1, 0, 0, 0, 263, 56, 1, 0, 0, 0, 264, 265, 5, 124,
|
||||
0, 0, 265, 269, 5, 124, 0, 0, 266, 267, 5, 111, 0, 0, 267, 269, 5, 114,
|
||||
0, 0, 268, 264, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 58, 1, 0, 0, 0,
|
||||
270, 271, 5, 126, 0, 0, 271, 60, 1, 0, 0, 0, 272, 277, 5, 33, 0, 0, 273,
|
||||
274, 5, 110, 0, 0, 274, 275, 5, 111, 0, 0, 275, 277, 5, 116, 0, 0, 276,
|
||||
272, 1, 0, 0, 0, 276, 273, 1, 0, 0, 0, 277, 62, 1, 0, 0, 0, 278, 279, 5,
|
||||
105, 0, 0, 279, 283, 5, 110, 0, 0, 280, 281, 5, 73, 0, 0, 281, 283, 5,
|
||||
78, 0, 0, 282, 278, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 64, 1, 0, 0,
|
||||
0, 284, 289, 5, 91, 0, 0, 285, 288, 3, 145, 72, 0, 286, 288, 3, 147, 73,
|
||||
0, 287, 285, 1, 0, 0, 0, 287, 286, 1, 0, 0, 0, 288, 291, 1, 0, 0, 0, 289,
|
||||
287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 292, 1, 0, 0, 0, 291, 289,
|
||||
1, 0, 0, 0, 292, 293, 5, 93, 0, 0, 293, 66, 1, 0, 0, 0, 294, 295, 5, 106,
|
||||
0, 0, 295, 296, 5, 115, 0, 0, 296, 297, 5, 111, 0, 0, 297, 298, 5, 110,
|
||||
0, 0, 298, 299, 5, 95, 0, 0, 299, 300, 5, 99, 0, 0, 300, 301, 5, 111, 0,
|
||||
0, 301, 302, 5, 110, 0, 0, 302, 303, 5, 116, 0, 0, 303, 304, 5, 97, 0,
|
||||
0, 304, 305, 5, 105, 0, 0, 305, 306, 5, 110, 0, 0, 306, 321, 5, 115, 0,
|
||||
0, 307, 308, 5, 74, 0, 0, 308, 309, 5, 83, 0, 0, 309, 310, 5, 79, 0, 0,
|
||||
310, 311, 5, 78, 0, 0, 311, 312, 5, 95, 0, 0, 312, 313, 5, 67, 0, 0, 313,
|
||||
314, 5, 79, 0, 0, 314, 315, 5, 78, 0, 0, 315, 316, 5, 84, 0, 0, 316, 317,
|
||||
5, 65, 0, 0, 317, 318, 5, 73, 0, 0, 318, 319, 5, 78, 0, 0, 319, 321, 5,
|
||||
83, 0, 0, 320, 294, 1, 0, 0, 0, 320, 307, 1, 0, 0, 0, 321, 68, 1, 0, 0,
|
||||
0, 322, 323, 5, 106, 0, 0, 323, 324, 5, 115, 0, 0, 324, 325, 5, 111, 0,
|
||||
0, 325, 326, 5, 110, 0, 0, 326, 327, 5, 95, 0, 0, 327, 328, 5, 99, 0, 0,
|
||||
328, 329, 5, 111, 0, 0, 329, 330, 5, 110, 0, 0, 330, 331, 5, 116, 0, 0,
|
||||
331, 332, 5, 97, 0, 0, 332, 333, 5, 105, 0, 0, 333, 334, 5, 110, 0, 0,
|
||||
334, 335, 5, 115, 0, 0, 335, 336, 5, 95, 0, 0, 336, 337, 5, 97, 0, 0, 337,
|
||||
338, 5, 108, 0, 0, 338, 357, 5, 108, 0, 0, 339, 340, 5, 74, 0, 0, 340,
|
||||
341, 5, 83, 0, 0, 341, 342, 5, 79, 0, 0, 342, 343, 5, 78, 0, 0, 343, 344,
|
||||
5, 95, 0, 0, 344, 345, 5, 67, 0, 0, 345, 346, 5, 79, 0, 0, 346, 347, 5,
|
||||
78, 0, 0, 347, 348, 5, 84, 0, 0, 348, 349, 5, 65, 0, 0, 349, 350, 5, 73,
|
||||
0, 0, 350, 351, 5, 78, 0, 0, 351, 352, 5, 83, 0, 0, 352, 353, 5, 95, 0,
|
||||
0, 353, 354, 5, 65, 0, 0, 354, 355, 5, 76, 0, 0, 355, 357, 5, 76, 0, 0,
|
||||
356, 322, 1, 0, 0, 0, 356, 339, 1, 0, 0, 0, 357, 70, 1, 0, 0, 0, 358, 359,
|
||||
5, 106, 0, 0, 359, 360, 5, 115, 0, 0, 360, 361, 5, 111, 0, 0, 361, 362,
|
||||
5, 110, 0, 0, 362, 363, 5, 95, 0, 0, 363, 364, 5, 99, 0, 0, 364, 365, 5,
|
||||
111, 0, 0, 365, 366, 5, 110, 0, 0, 366, 367, 5, 116, 0, 0, 367, 368, 5,
|
||||
97, 0, 0, 368, 369, 5, 105, 0, 0, 369, 370, 5, 110, 0, 0, 370, 371, 5,
|
||||
115, 0, 0, 371, 372, 5, 95, 0, 0, 372, 373, 5, 97, 0, 0, 373, 374, 5, 110,
|
||||
0, 0, 374, 393, 5, 121, 0, 0, 375, 376, 5, 74, 0, 0, 376, 377, 5, 83, 0,
|
||||
0, 377, 378, 5, 79, 0, 0, 378, 379, 5, 78, 0, 0, 379, 380, 5, 95, 0, 0,
|
||||
380, 381, 5, 67, 0, 0, 381, 382, 5, 79, 0, 0, 382, 383, 5, 78, 0, 0, 383,
|
||||
384, 5, 84, 0, 0, 384, 385, 5, 65, 0, 0, 385, 386, 5, 73, 0, 0, 386, 387,
|
||||
5, 78, 0, 0, 387, 388, 5, 83, 0, 0, 388, 389, 5, 95, 0, 0, 389, 390, 5,
|
||||
65, 0, 0, 390, 391, 5, 78, 0, 0, 391, 393, 5, 89, 0, 0, 392, 358, 1, 0,
|
||||
0, 0, 392, 375, 1, 0, 0, 0, 393, 72, 1, 0, 0, 0, 394, 395, 5, 97, 0, 0,
|
||||
395, 396, 5, 114, 0, 0, 396, 397, 5, 114, 0, 0, 397, 398, 5, 97, 0, 0,
|
||||
398, 399, 5, 121, 0, 0, 399, 400, 5, 95, 0, 0, 400, 401, 5, 99, 0, 0, 401,
|
||||
402, 5, 111, 0, 0, 402, 403, 5, 110, 0, 0, 403, 404, 5, 116, 0, 0, 404,
|
||||
405, 5, 97, 0, 0, 405, 406, 5, 105, 0, 0, 406, 407, 5, 110, 0, 0, 407,
|
||||
423, 5, 115, 0, 0, 408, 409, 5, 65, 0, 0, 409, 410, 5, 82, 0, 0, 410, 411,
|
||||
5, 82, 0, 0, 411, 412, 5, 65, 0, 0, 412, 413, 5, 89, 0, 0, 413, 414, 5,
|
||||
95, 0, 0, 414, 415, 5, 67, 0, 0, 415, 416, 5, 79, 0, 0, 416, 417, 5, 78,
|
||||
0, 0, 417, 418, 5, 84, 0, 0, 418, 419, 5, 65, 0, 0, 419, 420, 5, 73, 0,
|
||||
0, 420, 421, 5, 78, 0, 0, 421, 423, 5, 83, 0, 0, 422, 394, 1, 0, 0, 0,
|
||||
422, 408, 1, 0, 0, 0, 423, 74, 1, 0, 0, 0, 424, 425, 5, 97, 0, 0, 425,
|
||||
426, 5, 114, 0, 0, 426, 427, 5, 114, 0, 0, 427, 428, 5, 97, 0, 0, 428,
|
||||
429, 5, 121, 0, 0, 429, 430, 5, 95, 0, 0, 430, 431, 5, 99, 0, 0, 431, 432,
|
||||
5, 111, 0, 0, 432, 433, 5, 110, 0, 0, 433, 434, 5, 116, 0, 0, 434, 435,
|
||||
5, 97, 0, 0, 435, 436, 5, 105, 0, 0, 436, 437, 5, 110, 0, 0, 437, 438,
|
||||
5, 115, 0, 0, 438, 439, 5, 95, 0, 0, 439, 440, 5, 97, 0, 0, 440, 441, 5,
|
||||
108, 0, 0, 441, 461, 5, 108, 0, 0, 442, 443, 5, 65, 0, 0, 443, 444, 5,
|
||||
82, 0, 0, 444, 445, 5, 82, 0, 0, 445, 446, 5, 65, 0, 0, 446, 447, 5, 89,
|
||||
0, 0, 447, 448, 5, 95, 0, 0, 448, 449, 5, 67, 0, 0, 449, 450, 5, 79, 0,
|
||||
0, 450, 451, 5, 78, 0, 0, 451, 452, 5, 84, 0, 0, 452, 453, 5, 65, 0, 0,
|
||||
453, 454, 5, 73, 0, 0, 454, 455, 5, 78, 0, 0, 455, 456, 5, 83, 0, 0, 456,
|
||||
457, 5, 95, 0, 0, 457, 458, 5, 65, 0, 0, 458, 459, 5, 76, 0, 0, 459, 461,
|
||||
5, 76, 0, 0, 460, 424, 1, 0, 0, 0, 460, 442, 1, 0, 0, 0, 461, 76, 1, 0,
|
||||
0, 0, 462, 463, 5, 97, 0, 0, 463, 464, 5, 114, 0, 0, 464, 465, 5, 114,
|
||||
0, 0, 465, 466, 5, 97, 0, 0, 466, 467, 5, 121, 0, 0, 467, 468, 5, 95, 0,
|
||||
0, 468, 469, 5, 99, 0, 0, 469, 470, 5, 111, 0, 0, 470, 471, 5, 110, 0,
|
||||
0, 471, 472, 5, 116, 0, 0, 472, 473, 5, 97, 0, 0, 473, 474, 5, 105, 0,
|
||||
0, 474, 475, 5, 110, 0, 0, 475, 476, 5, 115, 0, 0, 476, 477, 5, 95, 0,
|
||||
0, 477, 478, 5, 97, 0, 0, 478, 479, 5, 110, 0, 0, 479, 499, 5, 121, 0,
|
||||
0, 480, 481, 5, 65, 0, 0, 481, 482, 5, 82, 0, 0, 482, 483, 5, 82, 0, 0,
|
||||
483, 484, 5, 65, 0, 0, 484, 485, 5, 89, 0, 0, 485, 486, 5, 95, 0, 0, 486,
|
||||
487, 5, 67, 0, 0, 487, 488, 5, 79, 0, 0, 488, 489, 5, 78, 0, 0, 489, 490,
|
||||
5, 84, 0, 0, 490, 491, 5, 65, 0, 0, 491, 492, 5, 73, 0, 0, 492, 493, 5,
|
||||
78, 0, 0, 493, 494, 5, 83, 0, 0, 494, 495, 5, 95, 0, 0, 495, 496, 5, 65,
|
||||
0, 0, 496, 497, 5, 78, 0, 0, 497, 499, 5, 89, 0, 0, 498, 462, 1, 0, 0,
|
||||
0, 498, 480, 1, 0, 0, 0, 499, 78, 1, 0, 0, 0, 500, 501, 5, 97, 0, 0, 501,
|
||||
502, 5, 114, 0, 0, 502, 503, 5, 114, 0, 0, 503, 504, 5, 97, 0, 0, 504,
|
||||
505, 5, 121, 0, 0, 505, 506, 5, 95, 0, 0, 506, 507, 5, 108, 0, 0, 507,
|
||||
508, 5, 101, 0, 0, 508, 509, 5, 110, 0, 0, 509, 510, 5, 103, 0, 0, 510,
|
||||
511, 5, 116, 0, 0, 511, 525, 5, 104, 0, 0, 512, 513, 5, 65, 0, 0, 513,
|
||||
514, 5, 82, 0, 0, 514, 515, 5, 82, 0, 0, 515, 516, 5, 65, 0, 0, 516, 517,
|
||||
5, 89, 0, 0, 517, 518, 5, 95, 0, 0, 518, 519, 5, 76, 0, 0, 519, 520, 5,
|
||||
69, 0, 0, 520, 521, 5, 78, 0, 0, 521, 522, 5, 71, 0, 0, 522, 523, 5, 84,
|
||||
0, 0, 523, 525, 5, 72, 0, 0, 524, 500, 1, 0, 0, 0, 524, 512, 1, 0, 0, 0,
|
||||
525, 80, 1, 0, 0, 0, 526, 527, 5, 116, 0, 0, 527, 528, 5, 114, 0, 0, 528,
|
||||
529, 5, 117, 0, 0, 529, 554, 5, 101, 0, 0, 530, 531, 5, 84, 0, 0, 531,
|
||||
532, 5, 114, 0, 0, 532, 533, 5, 117, 0, 0, 533, 554, 5, 101, 0, 0, 534,
|
||||
535, 5, 84, 0, 0, 535, 536, 5, 82, 0, 0, 536, 537, 5, 85, 0, 0, 537, 554,
|
||||
5, 69, 0, 0, 538, 539, 5, 102, 0, 0, 539, 540, 5, 97, 0, 0, 540, 541, 5,
|
||||
108, 0, 0, 541, 542, 5, 115, 0, 0, 542, 554, 5, 101, 0, 0, 543, 544, 5,
|
||||
70, 0, 0, 544, 545, 5, 97, 0, 0, 545, 546, 5, 108, 0, 0, 546, 547, 5, 115,
|
||||
0, 0, 547, 554, 5, 101, 0, 0, 548, 549, 5, 70, 0, 0, 549, 550, 5, 65, 0,
|
||||
0, 550, 551, 5, 76, 0, 0, 551, 552, 5, 83, 0, 0, 552, 554, 5, 69, 0, 0,
|
||||
553, 526, 1, 0, 0, 0, 553, 530, 1, 0, 0, 0, 553, 534, 1, 0, 0, 0, 553,
|
||||
538, 1, 0, 0, 0, 553, 543, 1, 0, 0, 0, 553, 548, 1, 0, 0, 0, 554, 82, 1,
|
||||
0, 0, 0, 555, 560, 3, 111, 55, 0, 556, 560, 3, 113, 56, 0, 557, 560, 3,
|
||||
115, 57, 0, 558, 560, 3, 109, 54, 0, 559, 555, 1, 0, 0, 0, 559, 556, 1,
|
||||
0, 0, 0, 559, 557, 1, 0, 0, 0, 559, 558, 1, 0, 0, 0, 560, 84, 1, 0, 0,
|
||||
0, 561, 564, 3, 127, 63, 0, 562, 564, 3, 129, 64, 0, 563, 561, 1, 0, 0,
|
||||
0, 563, 562, 1, 0, 0, 0, 564, 86, 1, 0, 0, 0, 565, 570, 3, 105, 52, 0,
|
||||
566, 569, 3, 105, 52, 0, 567, 569, 3, 107, 53, 0, 568, 566, 1, 0, 0, 0,
|
||||
568, 567, 1, 0, 0, 0, 569, 572, 1, 0, 0, 0, 570, 568, 1, 0, 0, 0, 570,
|
||||
571, 1, 0, 0, 0, 571, 88, 1, 0, 0, 0, 572, 570, 1, 0, 0, 0, 573, 574, 5,
|
||||
36, 0, 0, 574, 575, 5, 109, 0, 0, 575, 576, 5, 101, 0, 0, 576, 577, 5,
|
||||
116, 0, 0, 577, 578, 5, 97, 0, 0, 578, 90, 1, 0, 0, 0, 579, 581, 3, 95,
|
||||
47, 0, 580, 579, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 592, 1, 0, 0, 0,
|
||||
582, 584, 5, 34, 0, 0, 583, 585, 3, 97, 48, 0, 584, 583, 1, 0, 0, 0, 584,
|
||||
585, 1, 0, 0, 0, 585, 586, 1, 0, 0, 0, 586, 593, 5, 34, 0, 0, 587, 589,
|
||||
5, 39, 0, 0, 588, 590, 3, 99, 49, 0, 589, 588, 1, 0, 0, 0, 589, 590, 1,
|
||||
0, 0, 0, 590, 591, 1, 0, 0, 0, 591, 593, 5, 39, 0, 0, 592, 582, 1, 0, 0,
|
||||
0, 592, 587, 1, 0, 0, 0, 593, 92, 1, 0, 0, 0, 594, 597, 3, 87, 43, 0, 595,
|
||||
597, 3, 89, 44, 0, 596, 594, 1, 0, 0, 0, 596, 595, 1, 0, 0, 0, 597, 605,
|
||||
1, 0, 0, 0, 598, 601, 5, 91, 0, 0, 599, 602, 3, 91, 45, 0, 600, 602, 3,
|
||||
111, 55, 0, 601, 599, 1, 0, 0, 0, 601, 600, 1, 0, 0, 0, 602, 603, 1, 0,
|
||||
0, 0, 603, 604, 5, 93, 0, 0, 604, 606, 1, 0, 0, 0, 605, 598, 1, 0, 0, 0,
|
||||
606, 607, 1, 0, 0, 0, 607, 605, 1, 0, 0, 0, 607, 608, 1, 0, 0, 0, 608,
|
||||
94, 1, 0, 0, 0, 609, 610, 5, 117, 0, 0, 610, 613, 5, 56, 0, 0, 611, 613,
|
||||
7, 0, 0, 0, 612, 609, 1, 0, 0, 0, 612, 611, 1, 0, 0, 0, 613, 96, 1, 0,
|
||||
0, 0, 614, 616, 3, 101, 50, 0, 615, 614, 1, 0, 0, 0, 616, 617, 1, 0, 0,
|
||||
0, 617, 615, 1, 0, 0, 0, 617, 618, 1, 0, 0, 0, 618, 98, 1, 0, 0, 0, 619,
|
||||
621, 3, 103, 51, 0, 620, 619, 1, 0, 0, 0, 621, 622, 1, 0, 0, 0, 622, 620,
|
||||
1, 0, 0, 0, 622, 623, 1, 0, 0, 0, 623, 100, 1, 0, 0, 0, 624, 632, 8, 1,
|
||||
0, 0, 625, 632, 3, 143, 71, 0, 626, 627, 5, 92, 0, 0, 627, 632, 5, 10,
|
||||
0, 0, 628, 629, 5, 92, 0, 0, 629, 630, 5, 13, 0, 0, 630, 632, 5, 10, 0,
|
||||
0, 631, 624, 1, 0, 0, 0, 631, 625, 1, 0, 0, 0, 631, 626, 1, 0, 0, 0, 631,
|
||||
628, 1, 0, 0, 0, 632, 102, 1, 0, 0, 0, 633, 641, 8, 2, 0, 0, 634, 641,
|
||||
3, 143, 71, 0, 635, 636, 5, 92, 0, 0, 636, 641, 5, 10, 0, 0, 637, 638,
|
||||
5, 92, 0, 0, 638, 639, 5, 13, 0, 0, 639, 641, 5, 10, 0, 0, 640, 633, 1,
|
||||
0, 0, 0, 640, 634, 1, 0, 0, 0, 640, 635, 1, 0, 0, 0, 640, 637, 1, 0, 0,
|
||||
0, 641, 104, 1, 0, 0, 0, 642, 643, 7, 3, 0, 0, 643, 106, 1, 0, 0, 0, 644,
|
||||
645, 7, 4, 0, 0, 645, 108, 1, 0, 0, 0, 646, 647, 5, 48, 0, 0, 647, 649,
|
||||
7, 5, 0, 0, 648, 650, 7, 6, 0, 0, 649, 648, 1, 0, 0, 0, 650, 651, 1, 0,
|
||||
0, 0, 651, 649, 1, 0, 0, 0, 651, 652, 1, 0, 0, 0, 652, 110, 1, 0, 0, 0,
|
||||
653, 657, 3, 117, 58, 0, 654, 656, 3, 107, 53, 0, 655, 654, 1, 0, 0, 0,
|
||||
656, 659, 1, 0, 0, 0, 657, 655, 1, 0, 0, 0, 657, 658, 1, 0, 0, 0, 658,
|
||||
662, 1, 0, 0, 0, 659, 657, 1, 0, 0, 0, 660, 662, 5, 48, 0, 0, 661, 653,
|
||||
1, 0, 0, 0, 661, 660, 1, 0, 0, 0, 662, 112, 1, 0, 0, 0, 663, 667, 5, 48,
|
||||
0, 0, 664, 666, 3, 119, 59, 0, 665, 664, 1, 0, 0, 0, 666, 669, 1, 0, 0,
|
||||
0, 667, 665, 1, 0, 0, 0, 667, 668, 1, 0, 0, 0, 668, 114, 1, 0, 0, 0, 669,
|
||||
667, 1, 0, 0, 0, 670, 671, 5, 48, 0, 0, 671, 672, 7, 7, 0, 0, 672, 673,
|
||||
3, 139, 69, 0, 673, 116, 1, 0, 0, 0, 674, 675, 7, 8, 0, 0, 675, 118, 1,
|
||||
0, 0, 0, 676, 677, 7, 9, 0, 0, 677, 120, 1, 0, 0, 0, 678, 679, 7, 10, 0,
|
||||
0, 679, 122, 1, 0, 0, 0, 680, 681, 3, 121, 60, 0, 681, 682, 3, 121, 60,
|
||||
0, 682, 683, 3, 121, 60, 0, 683, 684, 3, 121, 60, 0, 684, 124, 1, 0, 0,
|
||||
0, 685, 686, 5, 92, 0, 0, 686, 687, 5, 117, 0, 0, 687, 688, 1, 0, 0, 0,
|
||||
688, 696, 3, 123, 61, 0, 689, 690, 5, 92, 0, 0, 690, 691, 5, 85, 0, 0,
|
||||
691, 692, 1, 0, 0, 0, 692, 693, 3, 123, 61, 0, 693, 694, 3, 123, 61, 0,
|
||||
694, 696, 1, 0, 0, 0, 695, 685, 1, 0, 0, 0, 695, 689, 1, 0, 0, 0, 696,
|
||||
126, 1, 0, 0, 0, 697, 699, 3, 131, 65, 0, 698, 700, 3, 133, 66, 0, 699,
|
||||
698, 1, 0, 0, 0, 699, 700, 1, 0, 0, 0, 700, 705, 1, 0, 0, 0, 701, 702,
|
||||
3, 135, 67, 0, 702, 703, 3, 133, 66, 0, 703, 705, 1, 0, 0, 0, 704, 697,
|
||||
1, 0, 0, 0, 704, 701, 1, 0, 0, 0, 705, 128, 1, 0, 0, 0, 706, 707, 5, 48,
|
||||
0, 0, 707, 710, 7, 7, 0, 0, 708, 711, 3, 137, 68, 0, 709, 711, 3, 139,
|
||||
69, 0, 710, 708, 1, 0, 0, 0, 710, 709, 1, 0, 0, 0, 711, 712, 1, 0, 0, 0,
|
||||
712, 713, 3, 141, 70, 0, 713, 130, 1, 0, 0, 0, 714, 716, 3, 135, 67, 0,
|
||||
715, 714, 1, 0, 0, 0, 715, 716, 1, 0, 0, 0, 716, 717, 1, 0, 0, 0, 717,
|
||||
718, 5, 46, 0, 0, 718, 723, 3, 135, 67, 0, 719, 720, 3, 135, 67, 0, 720,
|
||||
721, 5, 46, 0, 0, 721, 723, 1, 0, 0, 0, 722, 715, 1, 0, 0, 0, 722, 719,
|
||||
1, 0, 0, 0, 723, 132, 1, 0, 0, 0, 724, 726, 7, 11, 0, 0, 725, 727, 7, 12,
|
||||
0, 0, 726, 725, 1, 0, 0, 0, 726, 727, 1, 0, 0, 0, 727, 728, 1, 0, 0, 0,
|
||||
728, 729, 3, 135, 67, 0, 729, 134, 1, 0, 0, 0, 730, 732, 3, 107, 53, 0,
|
||||
731, 730, 1, 0, 0, 0, 732, 733, 1, 0, 0, 0, 733, 731, 1, 0, 0, 0, 733,
|
||||
734, 1, 0, 0, 0, 734, 136, 1, 0, 0, 0, 735, 737, 3, 139, 69, 0, 736, 735,
|
||||
1, 0, 0, 0, 736, 737, 1, 0, 0, 0, 737, 738, 1, 0, 0, 0, 738, 739, 5, 46,
|
||||
0, 0, 739, 744, 3, 139, 69, 0, 740, 741, 3, 139, 69, 0, 741, 742, 5, 46,
|
||||
0, 0, 742, 744, 1, 0, 0, 0, 743, 736, 1, 0, 0, 0, 743, 740, 1, 0, 0, 0,
|
||||
744, 138, 1, 0, 0, 0, 745, 747, 3, 121, 60, 0, 746, 745, 1, 0, 0, 0, 747,
|
||||
748, 1, 0, 0, 0, 748, 746, 1, 0, 0, 0, 748, 749, 1, 0, 0, 0, 749, 140,
|
||||
1, 0, 0, 0, 750, 752, 7, 13, 0, 0, 751, 753, 7, 12, 0, 0, 752, 751, 1,
|
||||
0, 0, 0, 752, 753, 1, 0, 0, 0, 753, 754, 1, 0, 0, 0, 754, 755, 3, 135,
|
||||
67, 0, 755, 142, 1, 0, 0, 0, 756, 757, 5, 92, 0, 0, 757, 772, 7, 14, 0,
|
||||
0, 758, 759, 5, 92, 0, 0, 759, 761, 3, 119, 59, 0, 760, 762, 3, 119, 59,
|
||||
0, 761, 760, 1, 0, 0, 0, 761, 762, 1, 0, 0, 0, 762, 764, 1, 0, 0, 0, 763,
|
||||
765, 3, 119, 59, 0, 764, 763, 1, 0, 0, 0, 764, 765, 1, 0, 0, 0, 765, 772,
|
||||
1, 0, 0, 0, 766, 767, 5, 92, 0, 0, 767, 768, 5, 120, 0, 0, 768, 769, 1,
|
||||
0, 0, 0, 769, 772, 3, 139, 69, 0, 770, 772, 3, 125, 62, 0, 771, 756, 1,
|
||||
0, 0, 0, 771, 758, 1, 0, 0, 0, 771, 766, 1, 0, 0, 0, 771, 770, 1, 0, 0,
|
||||
0, 772, 144, 1, 0, 0, 0, 773, 775, 7, 15, 0, 0, 774, 773, 1, 0, 0, 0, 775,
|
||||
776, 1, 0, 0, 0, 776, 774, 1, 0, 0, 0, 776, 777, 1, 0, 0, 0, 777, 778,
|
||||
1, 0, 0, 0, 778, 779, 6, 72, 0, 0, 779, 146, 1, 0, 0, 0, 780, 782, 5, 13,
|
||||
0, 0, 781, 783, 5, 10, 0, 0, 782, 781, 1, 0, 0, 0, 782, 783, 1, 0, 0, 0,
|
||||
783, 786, 1, 0, 0, 0, 784, 786, 5, 10, 0, 0, 785, 780, 1, 0, 0, 0, 785,
|
||||
784, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 788, 6, 73, 0, 0, 788, 148,
|
||||
1, 0, 0, 0, 56, 0, 187, 201, 230, 262, 268, 276, 282, 287, 289, 320, 356,
|
||||
392, 422, 460, 498, 524, 553, 559, 563, 568, 570, 580, 584, 589, 592, 596,
|
||||
601, 607, 612, 617, 622, 631, 640, 651, 657, 661, 667, 695, 699, 704, 710,
|
||||
715, 722, 726, 733, 736, 743, 748, 752, 761, 764, 771, 776, 782, 785, 1,
|
||||
6, 0, 0,
|
||||
}
|
||||
deserializer := antlr.NewATNDeserializer(nil)
|
||||
staticData.atn = deserializer.Deserialize(staticData.serializedATN)
|
||||
@ -470,45 +478,48 @@ const (
|
||||
PlanLexerT__2 = 3
|
||||
PlanLexerT__3 = 4
|
||||
PlanLexerT__4 = 5
|
||||
PlanLexerLT = 6
|
||||
PlanLexerLE = 7
|
||||
PlanLexerGT = 8
|
||||
PlanLexerGE = 9
|
||||
PlanLexerEQ = 10
|
||||
PlanLexerNE = 11
|
||||
PlanLexerLIKE = 12
|
||||
PlanLexerEXISTS = 13
|
||||
PlanLexerTEXTMATCH = 14
|
||||
PlanLexerADD = 15
|
||||
PlanLexerSUB = 16
|
||||
PlanLexerMUL = 17
|
||||
PlanLexerDIV = 18
|
||||
PlanLexerMOD = 19
|
||||
PlanLexerPOW = 20
|
||||
PlanLexerSHL = 21
|
||||
PlanLexerSHR = 22
|
||||
PlanLexerBAND = 23
|
||||
PlanLexerBOR = 24
|
||||
PlanLexerBXOR = 25
|
||||
PlanLexerAND = 26
|
||||
PlanLexerOR = 27
|
||||
PlanLexerBNOT = 28
|
||||
PlanLexerNOT = 29
|
||||
PlanLexerIN = 30
|
||||
PlanLexerEmptyArray = 31
|
||||
PlanLexerJSONContains = 32
|
||||
PlanLexerJSONContainsAll = 33
|
||||
PlanLexerJSONContainsAny = 34
|
||||
PlanLexerArrayContains = 35
|
||||
PlanLexerArrayContainsAll = 36
|
||||
PlanLexerArrayContainsAny = 37
|
||||
PlanLexerArrayLength = 38
|
||||
PlanLexerBooleanConstant = 39
|
||||
PlanLexerIntegerConstant = 40
|
||||
PlanLexerFloatingConstant = 41
|
||||
PlanLexerIdentifier = 42
|
||||
PlanLexerStringLiteral = 43
|
||||
PlanLexerJSONIdentifier = 44
|
||||
PlanLexerWhitespace = 45
|
||||
PlanLexerNewline = 46
|
||||
PlanLexerLBRACE = 6
|
||||
PlanLexerRBRACE = 7
|
||||
PlanLexerLT = 8
|
||||
PlanLexerLE = 9
|
||||
PlanLexerGT = 10
|
||||
PlanLexerGE = 11
|
||||
PlanLexerEQ = 12
|
||||
PlanLexerNE = 13
|
||||
PlanLexerLIKE = 14
|
||||
PlanLexerEXISTS = 15
|
||||
PlanLexerTEXTMATCH = 16
|
||||
PlanLexerADD = 17
|
||||
PlanLexerSUB = 18
|
||||
PlanLexerMUL = 19
|
||||
PlanLexerDIV = 20
|
||||
PlanLexerMOD = 21
|
||||
PlanLexerPOW = 22
|
||||
PlanLexerSHL = 23
|
||||
PlanLexerSHR = 24
|
||||
PlanLexerBAND = 25
|
||||
PlanLexerBOR = 26
|
||||
PlanLexerBXOR = 27
|
||||
PlanLexerAND = 28
|
||||
PlanLexerOR = 29
|
||||
PlanLexerBNOT = 30
|
||||
PlanLexerNOT = 31
|
||||
PlanLexerIN = 32
|
||||
PlanLexerEmptyArray = 33
|
||||
PlanLexerJSONContains = 34
|
||||
PlanLexerJSONContainsAll = 35
|
||||
PlanLexerJSONContainsAny = 36
|
||||
PlanLexerArrayContains = 37
|
||||
PlanLexerArrayContainsAll = 38
|
||||
PlanLexerArrayContainsAny = 39
|
||||
PlanLexerArrayLength = 40
|
||||
PlanLexerBooleanConstant = 41
|
||||
PlanLexerIntegerConstant = 42
|
||||
PlanLexerFloatingConstant = 43
|
||||
PlanLexerIdentifier = 44
|
||||
PlanLexerMeta = 45
|
||||
PlanLexerStringLiteral = 46
|
||||
PlanLexerJSONIdentifier = 47
|
||||
PlanLexerWhitespace = 48
|
||||
PlanLexerNewline = 49
|
||||
)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -37,6 +37,9 @@ type PlanVisitor interface {
|
||||
// Visit a parse tree produced by PlanParser#LogicalAnd.
|
||||
VisitLogicalAnd(ctx *LogicalAndContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by PlanParser#TemplateVariable.
|
||||
VisitTemplateVariable(ctx *TemplateVariableContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by PlanParser#Equality.
|
||||
VisitEquality(ctx *EqualityContext) interface{}
|
||||
|
||||
|
@ -39,3 +39,15 @@ func getGenericValue(obj interface{}) *planpb.GenericValue {
|
||||
}
|
||||
return expr.expr.GetValueExpr().GetValue()
|
||||
}
|
||||
|
||||
func getValueExpr(obj interface{}) *planpb.ValueExpr {
|
||||
expr := getExpr(obj)
|
||||
if expr == nil {
|
||||
return nil
|
||||
}
|
||||
return expr.expr.GetValueExpr()
|
||||
}
|
||||
|
||||
func isTemplateExpr(expr *planpb.ValueExpr) bool {
|
||||
return expr != nil && expr.GetTemplateVariableName() != ""
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func (v *ParserVisitor) translateIdentifier(identifier string) (*ExprWithType, e
|
||||
|
||||
// VisitIdentifier translates expr to column plan.
|
||||
func (v *ParserVisitor) VisitIdentifier(ctx *parser.IdentifierContext) interface{} {
|
||||
identifier := ctx.Identifier().GetText()
|
||||
identifier := ctx.GetText()
|
||||
expr, err := v.translateIdentifier(identifier)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -157,18 +157,23 @@ func checkDirectComparisonBinaryField(columnInfo *planpb.ColumnInfo) error {
|
||||
|
||||
// VisitAddSub translates expr to arithmetic plan.
|
||||
func (v *ParserVisitor) VisitAddSub(ctx *parser.AddSubContext) interface{} {
|
||||
var err error
|
||||
left := ctx.Expr(0).Accept(v)
|
||||
if err := getError(left); err != nil {
|
||||
if err = getError(left); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
right := ctx.Expr(1).Accept(v)
|
||||
if err := getError(right); err != nil {
|
||||
if err = getError(right); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
leftValue, rightValue := getGenericValue(left), getGenericValue(right)
|
||||
if leftValue != nil && rightValue != nil {
|
||||
leftValueExpr, rightValueExpr := getValueExpr(left), getValueExpr(right)
|
||||
if leftValueExpr != nil && rightValueExpr != nil {
|
||||
if isTemplateExpr(leftValueExpr) || isTemplateExpr(rightValueExpr) {
|
||||
return fmt.Errorf("placeholder was not supported between two constants with operator: %s", ctx.GetOp().GetText())
|
||||
}
|
||||
leftValue, rightValue := leftValueExpr.GetValue(), rightValueExpr.GetValue()
|
||||
switch ctx.GetOp().GetTokenType() {
|
||||
case parser.PlanParserADD:
|
||||
return Add(leftValue, rightValue)
|
||||
@ -179,34 +184,37 @@ func (v *ParserVisitor) VisitAddSub(ctx *parser.AddSubContext) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
var leftExpr *ExprWithType
|
||||
var rightExpr *ExprWithType
|
||||
leftExpr, rightExpr := getExpr(left), getExpr(right)
|
||||
reverse := true
|
||||
|
||||
if leftValue != nil {
|
||||
leftExpr = toValueExpr(leftValue)
|
||||
} else {
|
||||
if leftValueExpr == nil {
|
||||
reverse = false
|
||||
leftExpr = getExpr(left)
|
||||
}
|
||||
if rightValue != nil {
|
||||
rightExpr = toValueExpr(rightValue)
|
||||
} else {
|
||||
rightExpr = getExpr(right)
|
||||
}
|
||||
|
||||
if leftExpr == nil || rightExpr == nil {
|
||||
return fmt.Errorf("invalid arithmetic expression, left: %s, op: %s, right: %s", ctx.Expr(0).GetText(), ctx.GetOp(), ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
if err := checkDirectComparisonBinaryField(toColumnInfo(leftExpr)); err != nil {
|
||||
if err = checkDirectComparisonBinaryField(toColumnInfo(leftExpr)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := checkDirectComparisonBinaryField(toColumnInfo(rightExpr)); err != nil {
|
||||
if err = checkDirectComparisonBinaryField(toColumnInfo(rightExpr)); err != nil {
|
||||
return err
|
||||
}
|
||||
if !canArithmetic(leftExpr, rightExpr) {
|
||||
return fmt.Errorf("'%s' can only be used between integer or floating or json field expressions", arithNameMap[ctx.GetOp().GetTokenType()])
|
||||
var dataType schemapb.DataType
|
||||
if leftExpr.expr.GetIsTemplate() {
|
||||
dataType = rightExpr.dataType
|
||||
} else if rightExpr.expr.GetIsTemplate() {
|
||||
dataType = leftExpr.dataType
|
||||
} else {
|
||||
if !canArithmetic(leftExpr.dataType, getArrayElementType(leftExpr), rightExpr.dataType, getArrayElementType(rightExpr)) {
|
||||
return fmt.Errorf("'%s' can only be used between integer or floating or json field expressions", arithNameMap[ctx.GetOp().GetTokenType()])
|
||||
}
|
||||
|
||||
dataType, err = calcDataType(leftExpr, rightExpr, reverse)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
expr := &planpb.Expr{
|
||||
@ -217,10 +225,7 @@ func (v *ParserVisitor) VisitAddSub(ctx *parser.AddSubContext) interface{} {
|
||||
Op: arithExprMap[ctx.GetOp().GetTokenType()],
|
||||
},
|
||||
},
|
||||
}
|
||||
dataType, err := calcDataType(leftExpr, rightExpr, reverse)
|
||||
if err != nil {
|
||||
return err
|
||||
IsTemplate: leftExpr.expr.GetIsTemplate() || rightExpr.expr.GetIsTemplate(),
|
||||
}
|
||||
return &ExprWithType{
|
||||
expr: expr,
|
||||
@ -231,6 +236,7 @@ func (v *ParserVisitor) VisitAddSub(ctx *parser.AddSubContext) interface{} {
|
||||
|
||||
// VisitMulDivMod translates expr to arithmetic plan.
|
||||
func (v *ParserVisitor) VisitMulDivMod(ctx *parser.MulDivModContext) interface{} {
|
||||
var err error
|
||||
left := ctx.Expr(0).Accept(v)
|
||||
if err := getError(left); err != nil {
|
||||
return err
|
||||
@ -241,8 +247,12 @@ func (v *ParserVisitor) VisitMulDivMod(ctx *parser.MulDivModContext) interface{}
|
||||
return err
|
||||
}
|
||||
|
||||
leftValue, rightValue := getGenericValue(left), getGenericValue(right)
|
||||
if leftValue != nil && rightValue != nil {
|
||||
leftValueExpr, rightValueExpr := getValueExpr(left), getValueExpr(right)
|
||||
if leftValueExpr != nil && rightValueExpr != nil {
|
||||
if isTemplateExpr(leftValueExpr) || isTemplateExpr(rightValueExpr) {
|
||||
return fmt.Errorf("placeholder was not supported between two constants with operator: %s", ctx.GetOp().GetText())
|
||||
}
|
||||
leftValue, rightValue := getGenericValue(left), getGenericValue(right)
|
||||
switch ctx.GetOp().GetTokenType() {
|
||||
case parser.PlanParserMUL:
|
||||
return Multiply(leftValue, rightValue)
|
||||
@ -263,21 +273,12 @@ func (v *ParserVisitor) VisitMulDivMod(ctx *parser.MulDivModContext) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
var leftExpr *ExprWithType
|
||||
var rightExpr *ExprWithType
|
||||
leftExpr, rightExpr := getExpr(left), getExpr(right)
|
||||
reverse := true
|
||||
|
||||
if leftValue != nil {
|
||||
leftExpr = toValueExpr(leftValue)
|
||||
} else {
|
||||
leftExpr = getExpr(left)
|
||||
if leftValueExpr == nil {
|
||||
reverse = false
|
||||
}
|
||||
if rightValue != nil {
|
||||
rightExpr = toValueExpr(rightValue)
|
||||
} else {
|
||||
rightExpr = getExpr(right)
|
||||
}
|
||||
|
||||
if leftExpr == nil || rightExpr == nil {
|
||||
return fmt.Errorf("invalid arithmetic expression, left: %s, op: %s, right: %s", ctx.Expr(0).GetText(), ctx.GetOp(), ctx.Expr(1).GetText())
|
||||
@ -289,17 +290,27 @@ func (v *ParserVisitor) VisitMulDivMod(ctx *parser.MulDivModContext) interface{}
|
||||
if err := checkDirectComparisonBinaryField(toColumnInfo(rightExpr)); err != nil {
|
||||
return err
|
||||
}
|
||||
if !canArithmetic(leftExpr, rightExpr) {
|
||||
return fmt.Errorf("'%s' can only be used between integer or floating or json field expressions", arithNameMap[ctx.GetOp().GetTokenType()])
|
||||
|
||||
var dataType schemapb.DataType
|
||||
if leftExpr.expr.GetIsTemplate() {
|
||||
dataType = rightExpr.dataType
|
||||
} else if rightExpr.expr.GetIsTemplate() {
|
||||
dataType = leftExpr.dataType
|
||||
} else {
|
||||
if !canArithmetic(leftExpr.dataType, getArrayElementType(leftExpr), rightExpr.dataType, getArrayElementType(rightExpr)) {
|
||||
return fmt.Errorf("'%s' can only be used between integer or floating or json field expressions", arithNameMap[ctx.GetOp().GetTokenType()])
|
||||
}
|
||||
|
||||
if err = checkValidModArith(arithExprMap[ctx.GetOp().GetTokenType()], leftExpr.dataType, getArrayElementType(leftExpr), rightExpr.dataType, getArrayElementType(rightExpr)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dataType, err = calcDataType(leftExpr, rightExpr, reverse)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
switch ctx.GetOp().GetTokenType() {
|
||||
case parser.PlanParserMOD:
|
||||
if !isIntegerColumn(toColumnInfo(leftExpr)) && !isIntegerColumn(toColumnInfo(rightExpr)) {
|
||||
return fmt.Errorf("modulo can only apply on integer types")
|
||||
}
|
||||
default:
|
||||
}
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_BinaryArithExpr{
|
||||
BinaryArithExpr: &planpb.BinaryArithExpr{
|
||||
@ -308,11 +319,9 @@ func (v *ParserVisitor) VisitMulDivMod(ctx *parser.MulDivModContext) interface{}
|
||||
Op: arithExprMap[ctx.GetOp().GetTokenType()],
|
||||
},
|
||||
},
|
||||
IsTemplate: leftExpr.expr.GetIsTemplate() || rightExpr.expr.GetIsTemplate(),
|
||||
}
|
||||
dataType, err := calcDataType(leftExpr, rightExpr, reverse)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return &ExprWithType{
|
||||
expr: expr,
|
||||
dataType: dataType,
|
||||
@ -332,8 +341,12 @@ func (v *ParserVisitor) VisitEquality(ctx *parser.EqualityContext) interface{} {
|
||||
return err
|
||||
}
|
||||
|
||||
leftValue, rightValue := getGenericValue(left), getGenericValue(right)
|
||||
if leftValue != nil && rightValue != nil {
|
||||
leftValueExpr, rightValueExpr := getValueExpr(left), getValueExpr(right)
|
||||
if leftValueExpr != nil && rightValueExpr != nil {
|
||||
if isTemplateExpr(leftValueExpr) || isTemplateExpr(rightValueExpr) {
|
||||
return fmt.Errorf("placeholder was not supported between two constants with operator: %s", ctx.GetOp().GetText())
|
||||
}
|
||||
leftValue, rightValue := leftValueExpr.GetValue(), rightValueExpr.GetValue()
|
||||
var ret *ExprWithType
|
||||
switch ctx.GetOp().GetTokenType() {
|
||||
case parser.PlanParserEQ:
|
||||
@ -349,18 +362,7 @@ func (v *ParserVisitor) VisitEquality(ctx *parser.EqualityContext) interface{} {
|
||||
return ret
|
||||
}
|
||||
|
||||
var leftExpr *ExprWithType
|
||||
var rightExpr *ExprWithType
|
||||
if leftValue != nil {
|
||||
leftExpr = toValueExpr(leftValue)
|
||||
} else {
|
||||
leftExpr = getExpr(left)
|
||||
}
|
||||
if rightValue != nil {
|
||||
rightExpr = toValueExpr(rightValue)
|
||||
} else {
|
||||
rightExpr = getExpr(right)
|
||||
}
|
||||
leftExpr, rightExpr := getExpr(left), getExpr(right)
|
||||
|
||||
expr, err := HandleCompare(ctx.GetOp().GetTokenType(), leftExpr, rightExpr)
|
||||
if err != nil {
|
||||
@ -384,10 +386,12 @@ func (v *ParserVisitor) VisitRelational(ctx *parser.RelationalContext) interface
|
||||
if err := getError(right); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
leftValue, rightValue := getGenericValue(left), getGenericValue(right)
|
||||
|
||||
if leftValue != nil && rightValue != nil {
|
||||
leftValueExpr, rightValueExpr := getValueExpr(left), getValueExpr(right)
|
||||
if leftValueExpr != nil && rightValueExpr != nil {
|
||||
if isTemplateExpr(leftValueExpr) || isTemplateExpr(rightValueExpr) {
|
||||
return fmt.Errorf("placeholder was not supported between two constants with operator: %s", ctx.GetOp().GetText())
|
||||
}
|
||||
leftValue, rightValue := getGenericValue(left), getGenericValue(right)
|
||||
var ret *ExprWithType
|
||||
switch ctx.GetOp().GetTokenType() {
|
||||
case parser.PlanParserLT:
|
||||
@ -407,18 +411,7 @@ func (v *ParserVisitor) VisitRelational(ctx *parser.RelationalContext) interface
|
||||
return ret
|
||||
}
|
||||
|
||||
var leftExpr *ExprWithType
|
||||
var rightExpr *ExprWithType
|
||||
if leftValue != nil {
|
||||
leftExpr = toValueExpr(leftValue)
|
||||
} else {
|
||||
leftExpr = getExpr(left)
|
||||
}
|
||||
if rightValue != nil {
|
||||
rightExpr = toValueExpr(rightValue)
|
||||
} else {
|
||||
rightExpr = getExpr(right)
|
||||
}
|
||||
leftExpr, rightExpr := getExpr(left), getExpr(right)
|
||||
if err := checkDirectComparisonBinaryField(toColumnInfo(leftExpr)); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -540,31 +533,45 @@ func (v *ParserVisitor) VisitTerm(ctx *parser.TermContext) interface{} {
|
||||
if getError(term) != nil {
|
||||
return term
|
||||
}
|
||||
value := getGenericValue(term)
|
||||
if value == nil {
|
||||
return fmt.Errorf("value '%s' in list cannot be a non-const expression", ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
if !IsArray(value) {
|
||||
return fmt.Errorf("the right-hand side of 'in' must be a list, but got: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
values := value.GetArrayVal().GetArray()
|
||||
for i, e := range values {
|
||||
castedValue, err := castValue(dataType, e)
|
||||
if err != nil {
|
||||
return fmt.Errorf("value '%s' in list cannot be casted to %s", e.String(), dataType.String())
|
||||
valueExpr := getValueExpr(term)
|
||||
var placeholder string
|
||||
var isTemplate bool
|
||||
var values []*planpb.GenericValue
|
||||
if valueExpr.GetValue() == nil && valueExpr.GetTemplateVariableName() != "" {
|
||||
placeholder = valueExpr.GetTemplateVariableName()
|
||||
values = nil
|
||||
isTemplate = true
|
||||
} else {
|
||||
elementValue := valueExpr.GetValue()
|
||||
if elementValue == nil {
|
||||
return fmt.Errorf(
|
||||
"contains_any operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
if !IsArray(elementValue) {
|
||||
return fmt.Errorf("the right-hand side of 'in' must be a list, but got: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
array := elementValue.GetArrayVal().GetArray()
|
||||
values = make([]*planpb.GenericValue, len(array))
|
||||
for i, e := range array {
|
||||
castedValue, err := castValue(dataType, e)
|
||||
if err != nil {
|
||||
return fmt.Errorf("value '%s' in list cannot be casted to %s", e.String(), dataType.String())
|
||||
}
|
||||
values[i] = castedValue
|
||||
}
|
||||
values[i] = castedValue
|
||||
}
|
||||
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_TermExpr{
|
||||
TermExpr: &planpb.TermExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
Values: values,
|
||||
ColumnInfo: columnInfo,
|
||||
Values: values,
|
||||
TemplateVariableName: placeholder,
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplate,
|
||||
}
|
||||
if ctx.GetOp() != nil {
|
||||
expr = &planpb.Expr{
|
||||
@ -574,6 +581,7 @@ func (v *ParserVisitor) VisitTerm(ctx *parser.TermContext) interface{} {
|
||||
Child: expr,
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplate,
|
||||
}
|
||||
}
|
||||
return &ExprWithType{
|
||||
@ -638,12 +646,11 @@ func (v *ParserVisitor) VisitRange(ctx *parser.RangeContext) interface{} {
|
||||
return err
|
||||
}
|
||||
|
||||
lowerValue := getGenericValue(lower)
|
||||
upperValue := getGenericValue(upper)
|
||||
if lowerValue == nil {
|
||||
lowerValueExpr, upperValueExpr := getValueExpr(lower), getValueExpr(upper)
|
||||
if lowerValueExpr == nil {
|
||||
return fmt.Errorf("lowerbound cannot be a non-const expression: %s", ctx.Expr(0).GetText())
|
||||
}
|
||||
if upperValue == nil {
|
||||
if upperValueExpr == nil {
|
||||
return fmt.Errorf("upperbound cannot be a non-const expression: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
@ -652,52 +659,45 @@ func (v *ParserVisitor) VisitRange(ctx *parser.RangeContext) interface{} {
|
||||
fieldDataType = columnInfo.GetElementType()
|
||||
}
|
||||
|
||||
switch fieldDataType {
|
||||
case schemapb.DataType_String, schemapb.DataType_VarChar:
|
||||
if !IsString(lowerValue) || !IsString(upperValue) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
case schemapb.DataType_Bool:
|
||||
return fmt.Errorf("invalid range operations on boolean expr")
|
||||
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64:
|
||||
if !IsInteger(lowerValue) || !IsInteger(upperValue) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
case schemapb.DataType_Float, schemapb.DataType_Double:
|
||||
if !IsNumber(lowerValue) || !IsNumber(upperValue) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
if IsInteger(lowerValue) {
|
||||
lowerValue = NewFloat(float64(lowerValue.GetInt64Val()))
|
||||
}
|
||||
if IsInteger(upperValue) {
|
||||
upperValue = NewFloat(float64(upperValue.GetInt64Val()))
|
||||
lowerValue := lowerValueExpr.GetValue()
|
||||
upperValue := upperValueExpr.GetValue()
|
||||
if !isTemplateExpr(lowerValueExpr) {
|
||||
if err = checkRangeCompared(fieldDataType, lowerValue); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if !isTemplateExpr(upperValueExpr) {
|
||||
if err = checkRangeCompared(fieldDataType, upperValue); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
lowerInclusive := ctx.GetOp1().GetTokenType() == parser.PlanParserLE
|
||||
upperInclusive := ctx.GetOp2().GetTokenType() == parser.PlanParserLE
|
||||
|
||||
// if !(lowerInclusive && upperInclusive) {
|
||||
// if getGenericValue(GreaterEqual(lowerValue, upperValue)).GetBoolVal() {
|
||||
// return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
// }
|
||||
// } else {
|
||||
// if getGenericValue(Greater(lowerValue, upperValue)).GetBoolVal() {
|
||||
// return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
// }
|
||||
// }
|
||||
if !isTemplateExpr(lowerValueExpr) && !isTemplateExpr(upperValueExpr) {
|
||||
if !(lowerInclusive && upperInclusive) {
|
||||
if getGenericValue(GreaterEqual(lowerValue, upperValue)).GetBoolVal() {
|
||||
return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
}
|
||||
} else {
|
||||
if getGenericValue(Greater(lowerValue, upperValue)).GetBoolVal() {
|
||||
return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_BinaryRangeExpr{
|
||||
BinaryRangeExpr: &planpb.BinaryRangeExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
LowerInclusive: lowerInclusive,
|
||||
UpperInclusive: upperInclusive,
|
||||
LowerValue: lowerValue,
|
||||
UpperValue: upperValue,
|
||||
ColumnInfo: columnInfo,
|
||||
LowerInclusive: lowerInclusive,
|
||||
UpperInclusive: upperInclusive,
|
||||
LowerValue: lowerValue,
|
||||
UpperValue: upperValue,
|
||||
LowerTemplateVariableName: lowerValueExpr.GetTemplateVariableName(),
|
||||
UpperTemplateVariableName: upperValueExpr.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplateExpr(lowerValueExpr) || isTemplateExpr(upperValueExpr),
|
||||
}
|
||||
return &ExprWithType{
|
||||
expr: expr,
|
||||
@ -728,61 +728,58 @@ func (v *ParserVisitor) VisitReverseRange(ctx *parser.ReverseRangeContext) inter
|
||||
return err
|
||||
}
|
||||
|
||||
lowerValue := getGenericValue(lower)
|
||||
upperValue := getGenericValue(upper)
|
||||
if lowerValue == nil {
|
||||
lowerValueExpr, upperValueExpr := getValueExpr(lower), getValueExpr(upper)
|
||||
if lowerValueExpr == nil {
|
||||
return fmt.Errorf("lowerbound cannot be a non-const expression: %s", ctx.Expr(0).GetText())
|
||||
}
|
||||
if upperValue == nil {
|
||||
if upperValueExpr == nil {
|
||||
return fmt.Errorf("upperbound cannot be a non-const expression: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
switch columnInfo.GetDataType() {
|
||||
case schemapb.DataType_String, schemapb.DataType_VarChar:
|
||||
if !IsString(lowerValue) || !IsString(upperValue) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
case schemapb.DataType_Bool:
|
||||
return fmt.Errorf("invalid range operations on boolean expr")
|
||||
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64:
|
||||
if !IsInteger(lowerValue) || !IsInteger(upperValue) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
case schemapb.DataType_Float, schemapb.DataType_Double:
|
||||
if !IsNumber(lowerValue) || !IsNumber(upperValue) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
if IsInteger(lowerValue) {
|
||||
lowerValue = NewFloat(float64(lowerValue.GetInt64Val()))
|
||||
}
|
||||
if IsInteger(upperValue) {
|
||||
upperValue = NewFloat(float64(upperValue.GetInt64Val()))
|
||||
}
|
||||
fieldDataType := columnInfo.GetDataType()
|
||||
if typeutil.IsArrayType(columnInfo.GetDataType()) {
|
||||
fieldDataType = columnInfo.GetElementType()
|
||||
}
|
||||
|
||||
lowerValue := lowerValueExpr.GetValue()
|
||||
upperValue := upperValueExpr.GetValue()
|
||||
if !isTemplateExpr(lowerValueExpr) {
|
||||
if err = checkRangeCompared(fieldDataType, lowerValue); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if !isTemplateExpr(upperValueExpr) {
|
||||
if err = checkRangeCompared(fieldDataType, upperValue); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
lowerInclusive := ctx.GetOp2().GetTokenType() == parser.PlanParserGE
|
||||
upperInclusive := ctx.GetOp1().GetTokenType() == parser.PlanParserGE
|
||||
|
||||
// if !(lowerInclusive && upperInclusive) {
|
||||
// if getGenericValue(GreaterEqual(lowerValue, upperValue)).GetBoolVal() {
|
||||
// return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
// }
|
||||
// } else {
|
||||
// if getGenericValue(Greater(lowerValue, upperValue)).GetBoolVal() {
|
||||
// return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
// }
|
||||
// }
|
||||
if !isTemplateExpr(lowerValueExpr) && !isTemplateExpr(upperValueExpr) {
|
||||
if !(lowerInclusive && upperInclusive) {
|
||||
if getGenericValue(GreaterEqual(lowerValue, upperValue)).GetBoolVal() {
|
||||
return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
}
|
||||
} else {
|
||||
if getGenericValue(Greater(lowerValue, upperValue)).GetBoolVal() {
|
||||
return fmt.Errorf("invalid range: lowerbound is greater than upperbound")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_BinaryRangeExpr{
|
||||
BinaryRangeExpr: &planpb.BinaryRangeExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
LowerInclusive: lowerInclusive,
|
||||
UpperInclusive: upperInclusive,
|
||||
LowerValue: lowerValue,
|
||||
UpperValue: upperValue,
|
||||
ColumnInfo: columnInfo,
|
||||
LowerInclusive: lowerInclusive,
|
||||
UpperInclusive: upperInclusive,
|
||||
LowerValue: lowerValue,
|
||||
UpperValue: upperValue,
|
||||
LowerTemplateVariableName: lowerValueExpr.GetTemplateVariableName(),
|
||||
UpperTemplateVariableName: upperValueExpr.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplateExpr(lowerValueExpr) || isTemplateExpr(upperValueExpr),
|
||||
}
|
||||
return &ExprWithType{
|
||||
expr: expr,
|
||||
@ -881,6 +878,7 @@ func (v *ParserVisitor) VisitLogicalOr(ctx *parser.LogicalOrContext) interface{}
|
||||
Op: planpb.BinaryExpr_LogicalOr,
|
||||
},
|
||||
},
|
||||
IsTemplate: leftExpr.expr.GetIsTemplate() || rightExpr.expr.GetIsTemplate(),
|
||||
}
|
||||
|
||||
return &ExprWithType{
|
||||
@ -929,6 +927,7 @@ func (v *ParserVisitor) VisitLogicalAnd(ctx *parser.LogicalAndContext) interface
|
||||
Op: planpb.BinaryExpr_LogicalAnd,
|
||||
},
|
||||
},
|
||||
IsTemplate: leftExpr.expr.GetIsTemplate() || rightExpr.expr.GetIsTemplate(),
|
||||
}
|
||||
|
||||
return &ExprWithType{
|
||||
@ -1197,32 +1196,33 @@ func (v *ParserVisitor) VisitJSONContains(ctx *parser.JSONContainsContext) inter
|
||||
if err := getError(element); err != nil {
|
||||
return err
|
||||
}
|
||||
elementValue := getGenericValue(element)
|
||||
if elementValue == nil {
|
||||
elementExpr := getValueExpr(element)
|
||||
if elementExpr == nil {
|
||||
return fmt.Errorf(
|
||||
"contains operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
if typeutil.IsArrayType(columnInfo.GetDataType()) {
|
||||
valExpr := toValueExpr(elementValue)
|
||||
if !canBeCompared(field.(*ExprWithType), valExpr) {
|
||||
return fmt.Errorf("contains operation can't compare between array element type: %s and %s",
|
||||
columnInfo.GetElementType(),
|
||||
valExpr.dataType)
|
||||
}
|
||||
}
|
||||
var elements []*planpb.GenericValue
|
||||
|
||||
elements := make([]*planpb.GenericValue, 1)
|
||||
elements[0] = elementValue
|
||||
if !isTemplateExpr(elementExpr) {
|
||||
elements = make([]*planpb.GenericValue, 1)
|
||||
elementValue := elementExpr.GetValue()
|
||||
if err := checkContainsElement(field.(*ExprWithType), planpb.JSONContainsExpr_Contains, elementValue); err != nil {
|
||||
return err
|
||||
}
|
||||
elements[0] = elementValue
|
||||
}
|
||||
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_JsonContainsExpr{
|
||||
JsonContainsExpr: &planpb.JSONContainsExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
Elements: elements,
|
||||
Op: planpb.JSONContainsExpr_Contains,
|
||||
ElementsSameType: true,
|
||||
ColumnInfo: columnInfo,
|
||||
Elements: elements,
|
||||
Op: planpb.JSONContainsExpr_Contains,
|
||||
ElementsSameType: true,
|
||||
TemplateVariableName: elementExpr.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplateExpr(elementExpr),
|
||||
}
|
||||
return &ExprWithType{
|
||||
expr: expr,
|
||||
@ -1247,36 +1247,35 @@ func (v *ParserVisitor) VisitJSONContainsAll(ctx *parser.JSONContainsAllContext)
|
||||
if err := getError(element); err != nil {
|
||||
return err
|
||||
}
|
||||
elementValue := getGenericValue(element)
|
||||
if elementValue == nil {
|
||||
|
||||
elementExpr := getValueExpr(element)
|
||||
if elementExpr == nil {
|
||||
return fmt.Errorf(
|
||||
"contains_all operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
if elementValue.GetArrayVal() == nil {
|
||||
return fmt.Errorf("contains_all operation element must be an array")
|
||||
}
|
||||
|
||||
if typeutil.IsArrayType(columnInfo.GetDataType()) {
|
||||
for _, value := range elementValue.GetArrayVal().GetArray() {
|
||||
valExpr := toValueExpr(value)
|
||||
if !canBeCompared(field.(*ExprWithType), valExpr) {
|
||||
return fmt.Errorf("contains_all operation can't compare between array element type: %s and %s",
|
||||
columnInfo.GetElementType(),
|
||||
valExpr.dataType)
|
||||
}
|
||||
var elements []*planpb.GenericValue
|
||||
var sameType bool
|
||||
if !isTemplateExpr(elementExpr) {
|
||||
elementValue := elementExpr.GetValue()
|
||||
if err := checkContainsElement(field.(*ExprWithType), planpb.JSONContainsExpr_ContainsAll, elementValue); err != nil {
|
||||
return err
|
||||
}
|
||||
elements = elementValue.GetArrayVal().GetArray()
|
||||
sameType = elementValue.GetArrayVal().GetSameType()
|
||||
}
|
||||
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_JsonContainsExpr{
|
||||
JsonContainsExpr: &planpb.JSONContainsExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
Elements: elementValue.GetArrayVal().GetArray(),
|
||||
Op: planpb.JSONContainsExpr_ContainsAll,
|
||||
ElementsSameType: elementValue.GetArrayVal().GetSameType(),
|
||||
ColumnInfo: columnInfo,
|
||||
Elements: elements,
|
||||
Op: planpb.JSONContainsExpr_ContainsAll,
|
||||
ElementsSameType: sameType,
|
||||
TemplateVariableName: elementExpr.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplateExpr(elementExpr),
|
||||
}
|
||||
return &ExprWithType{
|
||||
expr: expr,
|
||||
@ -1301,36 +1300,35 @@ func (v *ParserVisitor) VisitJSONContainsAny(ctx *parser.JSONContainsAnyContext)
|
||||
if err := getError(element); err != nil {
|
||||
return err
|
||||
}
|
||||
elementValue := getGenericValue(element)
|
||||
if elementValue == nil {
|
||||
valueExpr := getValueExpr(element)
|
||||
|
||||
if valueExpr == nil {
|
||||
return fmt.Errorf(
|
||||
"contains_any operation are only supported explicitly specified element, got: %s", ctx.Expr(1).GetText())
|
||||
}
|
||||
|
||||
if elementValue.GetArrayVal() == nil {
|
||||
return fmt.Errorf("contains_any operation element must be an array")
|
||||
}
|
||||
|
||||
if typeutil.IsArrayType(columnInfo.GetDataType()) {
|
||||
for _, value := range elementValue.GetArrayVal().GetArray() {
|
||||
valExpr := toValueExpr(value)
|
||||
if !canBeCompared(field.(*ExprWithType), valExpr) {
|
||||
return fmt.Errorf("contains_any operation can't compare between array element type: %s and %s",
|
||||
columnInfo.GetElementType(),
|
||||
valExpr.dataType)
|
||||
}
|
||||
var elements []*planpb.GenericValue
|
||||
var sameType bool
|
||||
if !isTemplateExpr(valueExpr) {
|
||||
elementValue := valueExpr.GetValue()
|
||||
if err := checkContainsElement(field.(*ExprWithType), planpb.JSONContainsExpr_ContainsAny, elementValue); err != nil {
|
||||
return err
|
||||
}
|
||||
elements = elementValue.GetArrayVal().GetArray()
|
||||
sameType = elementValue.GetArrayVal().GetSameType()
|
||||
}
|
||||
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_JsonContainsExpr{
|
||||
JsonContainsExpr: &planpb.JSONContainsExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
Elements: elementValue.GetArrayVal().GetArray(),
|
||||
Op: planpb.JSONContainsExpr_ContainsAny,
|
||||
ElementsSameType: elementValue.GetArrayVal().GetSameType(),
|
||||
ColumnInfo: columnInfo,
|
||||
Elements: elements,
|
||||
Op: planpb.JSONContainsExpr_ContainsAny,
|
||||
ElementsSameType: sameType,
|
||||
TemplateVariableName: valueExpr.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplateExpr(valueExpr),
|
||||
}
|
||||
return &ExprWithType{
|
||||
expr: expr,
|
||||
@ -1370,3 +1368,17 @@ func (v *ParserVisitor) VisitArrayLength(ctx *parser.ArrayLengthContext) interfa
|
||||
nodeDependent: true,
|
||||
}
|
||||
}
|
||||
|
||||
func (v *ParserVisitor) VisitTemplateVariable(ctx *parser.TemplateVariableContext) interface{} {
|
||||
return &ExprWithType{
|
||||
expr: &planpb.Expr{
|
||||
Expr: &planpb.Expr_ValueExpr{
|
||||
ValueExpr: &planpb.ValueExpr{
|
||||
Value: nil,
|
||||
TemplateVariableName: ctx.Identifier().GetText(),
|
||||
},
|
||||
},
|
||||
IsTemplate: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ func handleExprWithErrorListener(schema *typeutil.SchemaHelper, exprStr string,
|
||||
return ast.Accept(visitor)
|
||||
}
|
||||
|
||||
func ParseExpr(schema *typeutil.SchemaHelper, exprStr string) (*planpb.Expr, error) {
|
||||
func ParseExpr(schema *typeutil.SchemaHelper, exprStr string, exprTemplateValues map[string]*schemapb.TemplateValue) (*planpb.Expr, error) {
|
||||
ret := handleExpr(schema, exprStr)
|
||||
|
||||
if err := getError(ret); err != nil {
|
||||
@ -93,6 +93,15 @@ func ParseExpr(schema *typeutil.SchemaHelper, exprStr string) (*planpb.Expr, err
|
||||
return nil, fmt.Errorf("predicate is not a boolean expression: %s, data type: %s", exprStr, predicate.dataType)
|
||||
}
|
||||
|
||||
valueMap, err := UnmarshalExpressionValues(exprTemplateValues)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := FillExpressionValue(predicate.expr, valueMap); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return predicate.expr, nil
|
||||
}
|
||||
|
||||
@ -114,8 +123,8 @@ func ParseIdentifier(schema *typeutil.SchemaHelper, identifier string, checkFunc
|
||||
return checkFunc(predicate.expr)
|
||||
}
|
||||
|
||||
func CreateRetrievePlan(schema *typeutil.SchemaHelper, exprStr string) (*planpb.PlanNode, error) {
|
||||
expr, err := ParseExpr(schema, exprStr)
|
||||
func CreateRetrievePlan(schema *typeutil.SchemaHelper, exprStr string, exprTemplateValues map[string]*schemapb.TemplateValue) (*planpb.PlanNode, error) {
|
||||
expr, err := ParseExpr(schema, exprStr, exprTemplateValues)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -160,12 +169,12 @@ func convertHanToASCII(s string) string {
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
func CreateSearchPlan(schema *typeutil.SchemaHelper, exprStr string, vectorFieldName string, queryInfo *planpb.QueryInfo) (*planpb.PlanNode, error) {
|
||||
func CreateSearchPlan(schema *typeutil.SchemaHelper, exprStr string, vectorFieldName string, queryInfo *planpb.QueryInfo, exprTemplateValues map[string]*schemapb.TemplateValue) (*planpb.PlanNode, error) {
|
||||
parse := func() (*planpb.Expr, error) {
|
||||
if len(exprStr) <= 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return ParseExpr(schema, exprStr)
|
||||
return ParseExpr(schema, exprStr, exprTemplateValues)
|
||||
}
|
||||
|
||||
expr, err := parse()
|
||||
|
@ -58,7 +58,7 @@ func newTestSchemaHelper(t *testing.T) *typeutil.SchemaHelper {
|
||||
}
|
||||
|
||||
func assertValidExpr(t *testing.T, helper *typeutil.SchemaHelper, exprStr string) {
|
||||
expr, err := ParseExpr(helper, exprStr)
|
||||
expr, err := ParseExpr(helper, exprStr, nil)
|
||||
assert.NoError(t, err, exprStr)
|
||||
// fmt.Printf("expr: %s\n", exprStr)
|
||||
assert.NotNil(t, expr, exprStr)
|
||||
@ -66,7 +66,7 @@ func assertValidExpr(t *testing.T, helper *typeutil.SchemaHelper, exprStr string
|
||||
}
|
||||
|
||||
func assertInvalidExpr(t *testing.T, helper *typeutil.SchemaHelper, exprStr string) {
|
||||
_, err := ParseExpr(helper, exprStr)
|
||||
_, err := ParseExpr(helper, exprStr, nil)
|
||||
assert.Error(t, err, exprStr)
|
||||
}
|
||||
|
||||
@ -125,14 +125,14 @@ func TestExpr_Call(t *testing.T) {
|
||||
{`f5(3+3, Int32Field)`, "f5", 2},
|
||||
}
|
||||
for _, testcase := range testcases {
|
||||
expr, err := ParseExpr(helper, testcase.CallExpr)
|
||||
expr, err := ParseExpr(helper, testcase.CallExpr, nil)
|
||||
assert.NoError(t, err, testcase)
|
||||
assert.Equal(t, testcase.FunctionName, expr.GetCallExpr().FunctionName, testcase)
|
||||
assert.Equal(t, testcase.ParameterNum, len(expr.GetCallExpr().FunctionParameters), testcase)
|
||||
ShowExpr(expr)
|
||||
}
|
||||
|
||||
expr, err := ParseExpr(helper, "xxx(1+1, !true, f(10+10))")
|
||||
expr, err := ParseExpr(helper, "xxx(1+1, !true, f(10+10))", nil)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "xxx", expr.GetCallExpr().FunctionName)
|
||||
assert.Equal(t, 3, len(expr.GetCallExpr().FunctionParameters))
|
||||
@ -283,6 +283,7 @@ func TestExpr_BinaryArith(t *testing.T) {
|
||||
`Int64Field % 10 == 9`,
|
||||
`Int64Field % 10 != 9`,
|
||||
`FloatField + 1.1 == 2.1`,
|
||||
`Int64Field + 1.1 == 2.1`,
|
||||
`A % 10 != 2`,
|
||||
`Int8Field + 1 < 2`,
|
||||
`Int16Field - 3 <= 4`,
|
||||
@ -300,13 +301,6 @@ func TestExpr_BinaryArith(t *testing.T) {
|
||||
assertValidExpr(t, helper, exprStr)
|
||||
}
|
||||
|
||||
invalidExprs := []string{
|
||||
`Int64Field + 1.1 == 2.1`,
|
||||
}
|
||||
for _, exprStr := range invalidExprs {
|
||||
assertInvalidExpr(t, helper, exprStr)
|
||||
}
|
||||
|
||||
// TODO: enable these after execution backend is ready.
|
||||
unsupported := []string{
|
||||
`ArrayField + 15 == 16`,
|
||||
@ -457,7 +451,7 @@ func TestExpr_Combinations(t *testing.T) {
|
||||
|
||||
func TestCreateRetrievePlan(t *testing.T) {
|
||||
schema := newTestSchemaHelper(t)
|
||||
_, err := CreateRetrievePlan(schema, "Int64Field > 0")
|
||||
_, err := CreateRetrievePlan(schema, "Int64Field > 0", nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@ -468,7 +462,7 @@ func TestCreateSearchPlan(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@ -479,7 +473,7 @@ func TestCreateFloat16SearchPlan(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@ -490,7 +484,7 @@ func TestCreateBFloat16earchPlan(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@ -501,7 +495,7 @@ func TestCreateSparseFloatVectorSearchPlan(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@ -646,7 +640,7 @@ func TestExpr_Invalid(t *testing.T) {
|
||||
`[1,2,3] == 1`,
|
||||
}
|
||||
for _, exprStr := range exprStrs {
|
||||
_, err := ParseExpr(helper, exprStr)
|
||||
_, err := ParseExpr(helper, exprStr, nil)
|
||||
assert.Error(t, err, exprStr)
|
||||
}
|
||||
}
|
||||
@ -654,7 +648,7 @@ func TestExpr_Invalid(t *testing.T) {
|
||||
func TestCreateRetrievePlan_Invalid(t *testing.T) {
|
||||
t.Run("invalid expr", func(t *testing.T) {
|
||||
schema := newTestSchemaHelper(t)
|
||||
_, err := CreateRetrievePlan(schema, "invalid expression")
|
||||
_, err := CreateRetrievePlan(schema, "invalid expression", nil)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
}
|
||||
@ -662,19 +656,19 @@ func TestCreateRetrievePlan_Invalid(t *testing.T) {
|
||||
func TestCreateSearchPlan_Invalid(t *testing.T) {
|
||||
t.Run("invalid expr", func(t *testing.T) {
|
||||
schema := newTestSchemaHelper(t)
|
||||
_, err := CreateSearchPlan(schema, "invalid expression", "", nil)
|
||||
_, err := CreateSearchPlan(schema, "invalid expression", "", nil, nil)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("invalid vector field", func(t *testing.T) {
|
||||
schema := newTestSchemaHelper(t)
|
||||
_, err := CreateSearchPlan(schema, "Int64Field > 0", "not_exist", nil)
|
||||
_, err := CreateSearchPlan(schema, "Int64Field > 0", "not_exist", nil, nil)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("not vector type", func(t *testing.T) {
|
||||
schema := newTestSchemaHelper(t)
|
||||
_, err := CreateSearchPlan(schema, "Int64Field > 0", "VarCharField", nil)
|
||||
_, err := CreateSearchPlan(schema, "Int64Field > 0", "VarCharField", nil, nil)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
}
|
||||
@ -818,7 +812,7 @@ func Test_JSONExpr(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
}
|
||||
@ -847,7 +841,7 @@ func Test_InvalidExprOnJSONField(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err, expr)
|
||||
}
|
||||
}
|
||||
@ -884,7 +878,7 @@ func Test_InvalidExprWithoutJSONField(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
}
|
||||
@ -921,7 +915,7 @@ func Test_InvalidExprWithMultipleJSONField(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
}
|
||||
@ -942,7 +936,7 @@ func Test_exprWithSingleQuotes(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@ -957,7 +951,7 @@ func Test_exprWithSingleQuotes(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
}
|
||||
@ -993,7 +987,7 @@ func Test_JSONContains(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
}
|
||||
@ -1022,7 +1016,7 @@ func Test_InvalidJSONContains(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
}
|
||||
@ -1085,7 +1079,7 @@ func Test_EscapeString(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
@ -1102,7 +1096,7 @@ c'`,
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err)
|
||||
fmt.Println(plan)
|
||||
}
|
||||
@ -1128,7 +1122,7 @@ func Test_JSONContainsAll(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, plan.GetVectorAnns().GetPredicates().GetJsonContainsExpr())
|
||||
assert.Equal(t, planpb.JSONContainsExpr_ContainsAll, plan.GetVectorAnns().GetPredicates().GetJsonContainsExpr().GetOp())
|
||||
@ -1149,7 +1143,7 @@ func Test_JSONContainsAll(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
}
|
||||
@ -1174,7 +1168,7 @@ func Test_JSONContainsAny(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, plan.GetVectorAnns().GetPredicates().GetJsonContainsExpr())
|
||||
assert.Equal(t, planpb.JSONContainsExpr_ContainsAny, plan.GetVectorAnns().GetPredicates().GetJsonContainsExpr().GetOp())
|
||||
@ -1195,7 +1189,7 @@ func Test_JSONContainsAny(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err)
|
||||
}
|
||||
}
|
||||
@ -1243,7 +1237,7 @@ func Test_ArrayExpr(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err, expr)
|
||||
}
|
||||
|
||||
@ -1277,7 +1271,7 @@ func Test_ArrayExpr(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err, expr)
|
||||
}
|
||||
}
|
||||
@ -1305,7 +1299,7 @@ func Test_ArrayLength(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(t, err, expr)
|
||||
}
|
||||
|
||||
@ -1331,7 +1325,7 @@ func Test_ArrayLength(t *testing.T) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.Error(t, err, expr)
|
||||
}
|
||||
}
|
||||
@ -1413,7 +1407,7 @@ func BenchmarkWithString(b *testing.B) {
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
})
|
||||
}, nil)
|
||||
assert.NoError(b, err)
|
||||
assert.NotNil(b, plan)
|
||||
}
|
||||
@ -1434,3 +1428,30 @@ func Test_convertHanToASCII(t *testing.T) {
|
||||
assert.Equal(t, c.target, convertHanToASCII(c.source))
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkTemplateWithString(b *testing.B) {
|
||||
schema := newTestSchema()
|
||||
schemaHelper, err := typeutil.CreateSchemaHelper(schema)
|
||||
require.NoError(b, err)
|
||||
|
||||
elements := make([]interface{}, 100)
|
||||
for i := 0; i < 100; i++ {
|
||||
elements[i] = generateExpressionFieldData(schemapb.DataType_String, fmt.Sprintf(`"%s",`, randomChineseString(rand.Intn(100))))
|
||||
}
|
||||
expr := "StringField in {list}"
|
||||
|
||||
mv := map[string]*schemapb.TemplateValue{
|
||||
"list": generateExpressionFieldData(schemapb.DataType_Array, elements),
|
||||
}
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
plan, err := CreateSearchPlan(schemaHelper, expr, "FloatVectorField", &planpb.QueryInfo{
|
||||
Topk: 0,
|
||||
MetricType: "",
|
||||
SearchParams: "",
|
||||
RoundDecimal: 0,
|
||||
}, mv)
|
||||
assert.NoError(b, err)
|
||||
assert.NotNil(b, plan)
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,9 @@ func extractColumnInfo(info *planpb.ColumnInfo) interface{} {
|
||||
}
|
||||
|
||||
func extractGenericValue(value *planpb.GenericValue) interface{} {
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
switch realValue := value.Val.(type) {
|
||||
case *planpb.GenericValue_BoolVal:
|
||||
return realValue.BoolVal
|
||||
|
@ -1,6 +1,7 @@
|
||||
package planparserv2
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -86,6 +87,19 @@ func NewString(value string) *planpb.GenericValue {
|
||||
}
|
||||
}
|
||||
|
||||
func toColumnExpr(info *planpb.ColumnInfo) *ExprWithType {
|
||||
return &ExprWithType{
|
||||
expr: &planpb.Expr{
|
||||
Expr: &planpb.Expr_ColumnExpr{
|
||||
ColumnExpr: &planpb.ColumnExpr{
|
||||
Info: info,
|
||||
},
|
||||
},
|
||||
},
|
||||
dataType: info.GetDataType(),
|
||||
}
|
||||
}
|
||||
|
||||
func toValueExpr(n *planpb.GenericValue) *ExprWithType {
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_ValueExpr{
|
||||
@ -126,14 +140,7 @@ func toValueExpr(n *planpb.GenericValue) *ExprWithType {
|
||||
}
|
||||
}
|
||||
|
||||
func getSameType(left, right *ExprWithType) (schemapb.DataType, error) {
|
||||
lDataType, rDataType := left.dataType, right.dataType
|
||||
if typeutil.IsArrayType(lDataType) {
|
||||
lDataType = toColumnInfo(left).GetElementType()
|
||||
}
|
||||
if typeutil.IsArrayType(rDataType) {
|
||||
rDataType = toColumnInfo(right).GetElementType()
|
||||
}
|
||||
func getTargetType(lDataType, rDataType schemapb.DataType) (schemapb.DataType, error) {
|
||||
if typeutil.IsJSONType(lDataType) {
|
||||
if typeutil.IsJSONType(rDataType) {
|
||||
return schemapb.DataType_JSON, nil
|
||||
@ -162,6 +169,17 @@ func getSameType(left, right *ExprWithType) (schemapb.DataType, error) {
|
||||
return schemapb.DataType_None, fmt.Errorf("incompatible data type, %s, %s", lDataType.String(), rDataType.String())
|
||||
}
|
||||
|
||||
func getSameType(left, right *ExprWithType) (schemapb.DataType, error) {
|
||||
lDataType, rDataType := left.dataType, right.dataType
|
||||
if typeutil.IsArrayType(lDataType) {
|
||||
lDataType = toColumnInfo(left).GetElementType()
|
||||
}
|
||||
if typeutil.IsArrayType(rDataType) {
|
||||
rDataType = toColumnInfo(right).GetElementType()
|
||||
}
|
||||
return getTargetType(lDataType, rDataType)
|
||||
}
|
||||
|
||||
func calcDataType(left, right *ExprWithType, reverse bool) (schemapb.DataType, error) {
|
||||
if reverse {
|
||||
return getSameType(right, left)
|
||||
@ -223,47 +241,44 @@ func castValue(dataType schemapb.DataType, value *planpb.GenericValue) (*planpb.
|
||||
return nil, fmt.Errorf("cannot cast value to %s, value: %s", dataType.String(), value)
|
||||
}
|
||||
|
||||
func combineBinaryArithExpr(op planpb.OpType, arithOp planpb.ArithOpType, columnInfo *planpb.ColumnInfo, operand *planpb.GenericValue, value *planpb.GenericValue) (*planpb.Expr, error) {
|
||||
dataType := columnInfo.GetDataType()
|
||||
if typeutil.IsArrayType(dataType) && len(columnInfo.GetNestedPath()) != 0 {
|
||||
dataType = columnInfo.GetElementType()
|
||||
}
|
||||
castedValue, err := castValue(dataType, operand)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
func combineBinaryArithExpr(op planpb.OpType, arithOp planpb.ArithOpType, columnInfo *planpb.ColumnInfo, operandExpr, valueExpr *planpb.ValueExpr) *planpb.Expr {
|
||||
return &planpb.Expr{
|
||||
Expr: &planpb.Expr_BinaryArithOpEvalRangeExpr{
|
||||
BinaryArithOpEvalRangeExpr: &planpb.BinaryArithOpEvalRangeExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
ArithOp: arithOp,
|
||||
RightOperand: castedValue,
|
||||
Op: op,
|
||||
Value: value,
|
||||
ColumnInfo: columnInfo,
|
||||
ArithOp: arithOp,
|
||||
RightOperand: operandExpr.GetValue(),
|
||||
Op: op,
|
||||
Value: valueExpr.GetValue(),
|
||||
OperandTemplateVariableName: operandExpr.GetTemplateVariableName(),
|
||||
ValueTemplateVariableName: valueExpr.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
IsTemplate: isTemplateExpr(operandExpr) || isTemplateExpr(valueExpr),
|
||||
}
|
||||
}
|
||||
|
||||
func combineArrayLengthExpr(op planpb.OpType, arithOp planpb.ArithOpType, columnInfo *planpb.ColumnInfo, value *planpb.GenericValue) (*planpb.Expr, error) {
|
||||
func combineArrayLengthExpr(op planpb.OpType, arithOp planpb.ArithOpType, columnInfo *planpb.ColumnInfo, valueExpr *planpb.ValueExpr) (*planpb.Expr, error) {
|
||||
return &planpb.Expr{
|
||||
Expr: &planpb.Expr_BinaryArithOpEvalRangeExpr{
|
||||
BinaryArithOpEvalRangeExpr: &planpb.BinaryArithOpEvalRangeExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
ArithOp: arithOp,
|
||||
Op: op,
|
||||
Value: value,
|
||||
ColumnInfo: columnInfo,
|
||||
ArithOp: arithOp,
|
||||
Op: op,
|
||||
Value: valueExpr.GetValue(),
|
||||
ValueTemplateVariableName: valueExpr.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplateExpr(valueExpr),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr, valueExpr *planpb.ValueExpr) (*planpb.Expr, error) {
|
||||
func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr, arithExprDataType schemapb.DataType, valueExpr *planpb.ValueExpr) (*planpb.Expr, error) {
|
||||
leftExpr, leftValue := arithExpr.Left.GetColumnExpr(), arithExpr.Left.GetValueExpr()
|
||||
rightExpr, rightValue := arithExpr.Right.GetColumnExpr(), arithExpr.Right.GetValueExpr()
|
||||
arithOp := arithExpr.GetOp()
|
||||
if arithOp == planpb.ArithOpType_ArrayLength {
|
||||
return combineArrayLengthExpr(op, arithOp, leftExpr.GetInfo(), valueExpr.GetValue())
|
||||
return combineArrayLengthExpr(op, arithOp, leftExpr.GetInfo(), valueExpr)
|
||||
}
|
||||
|
||||
if leftExpr != nil && rightExpr != nil {
|
||||
@ -282,7 +297,7 @@ func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr,
|
||||
// a * 2 == 3
|
||||
// a / 2 == 3
|
||||
// a % 2 == 3
|
||||
return combineBinaryArithExpr(op, arithOp, leftExpr.GetInfo(), rightValue.GetValue(), valueExpr.GetValue())
|
||||
return combineBinaryArithExpr(op, arithOp, leftExpr.GetInfo(), rightValue, valueExpr), nil
|
||||
} else if rightExpr != nil && leftValue != nil {
|
||||
// 2 + a == 3
|
||||
// 2 - a == 3
|
||||
@ -292,7 +307,7 @@ func handleBinaryArithExpr(op planpb.OpType, arithExpr *planpb.BinaryArithExpr,
|
||||
|
||||
switch arithExpr.GetOp() {
|
||||
case planpb.ArithOpType_Add, planpb.ArithOpType_Mul:
|
||||
return combineBinaryArithExpr(op, arithOp, rightExpr.GetInfo(), leftValue.GetValue(), valueExpr.GetValue())
|
||||
return combineBinaryArithExpr(op, arithOp, rightExpr.GetInfo(), leftValue, valueExpr), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("module field is not yet supported")
|
||||
}
|
||||
@ -307,13 +322,17 @@ func handleCompareRightValue(op planpb.OpType, left *ExprWithType, right *planpb
|
||||
if typeutil.IsArrayType(dataType) && len(toColumnInfo(left).GetNestedPath()) != 0 {
|
||||
dataType = toColumnInfo(left).GetElementType()
|
||||
}
|
||||
castedValue, err := castValue(dataType, right.GetValue())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
if !left.expr.GetIsTemplate() && !isTemplateExpr(right) {
|
||||
castedValue, err := castValue(dataType, right.GetValue())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
right = &planpb.ValueExpr{Value: castedValue}
|
||||
}
|
||||
|
||||
if leftArithExpr := left.expr.GetBinaryArithExpr(); leftArithExpr != nil {
|
||||
return handleBinaryArithExpr(op, leftArithExpr, &planpb.ValueExpr{Value: castedValue})
|
||||
return handleBinaryArithExpr(op, leftArithExpr, left.dataType, right)
|
||||
}
|
||||
|
||||
columnInfo := toColumnInfo(left)
|
||||
@ -323,11 +342,13 @@ func handleCompareRightValue(op planpb.OpType, left *ExprWithType, right *planpb
|
||||
expr := &planpb.Expr{
|
||||
Expr: &planpb.Expr_UnaryRangeExpr{
|
||||
UnaryRangeExpr: &planpb.UnaryRangeExpr{
|
||||
ColumnInfo: columnInfo,
|
||||
Op: op,
|
||||
Value: castedValue,
|
||||
ColumnInfo: columnInfo,
|
||||
Op: op,
|
||||
Value: right.GetValue(),
|
||||
TemplateVariableName: right.GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
IsTemplate: isTemplateExpr(right),
|
||||
}
|
||||
|
||||
switch op {
|
||||
@ -342,6 +363,19 @@ func handleCompare(op planpb.OpType, left *ExprWithType, right *ExprWithType) (*
|
||||
leftColumnInfo := toColumnInfo(left)
|
||||
rightColumnInfo := toColumnInfo(right)
|
||||
|
||||
if left.expr.GetIsTemplate() {
|
||||
return &planpb.Expr{
|
||||
Expr: &planpb.Expr_UnaryRangeExpr{
|
||||
UnaryRangeExpr: &planpb.UnaryRangeExpr{
|
||||
ColumnInfo: rightColumnInfo,
|
||||
Op: op,
|
||||
Value: left.expr.GetValueExpr().GetValue(),
|
||||
TemplateVariableName: left.expr.GetValueExpr().GetTemplateVariableName(),
|
||||
},
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
if leftColumnInfo == nil || rightColumnInfo == nil {
|
||||
return nil, fmt.Errorf("only comparison between two fields is supported")
|
||||
}
|
||||
@ -417,9 +451,11 @@ func getDataType(expr *ExprWithType) string {
|
||||
}
|
||||
|
||||
func HandleCompare(op int, left, right *ExprWithType) (*planpb.Expr, error) {
|
||||
if !canBeCompared(left, right) {
|
||||
return nil, fmt.Errorf("comparisons between %s and %s are not supported",
|
||||
getDataType(left), getDataType(right))
|
||||
if !left.expr.GetIsTemplate() && !right.expr.GetIsTemplate() {
|
||||
if !canBeCompared(left, right) {
|
||||
return nil, fmt.Errorf("comparisons between %s and %s are not supported",
|
||||
getDataType(left), getDataType(right))
|
||||
}
|
||||
}
|
||||
|
||||
cmpOp := cmpOpMap[op]
|
||||
@ -521,23 +557,39 @@ func canArithmeticDataType(left, right schemapb.DataType) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func canArithmetic(left *ExprWithType, right *ExprWithType) bool {
|
||||
if !typeutil.IsArrayType(left.dataType) && !typeutil.IsArrayType(right.dataType) {
|
||||
return canArithmeticDataType(left.dataType, right.dataType)
|
||||
//func canArithmetic(left *ExprWithType, right *ExprWithType) bool {
|
||||
// if !typeutil.IsArrayType(left.dataType) && !typeutil.IsArrayType(right.dataType) {
|
||||
// return canArithmeticDataType(left.dataType, right.dataType)
|
||||
// }
|
||||
// if typeutil.IsArrayType(left.dataType) && typeutil.IsArrayType(right.dataType) {
|
||||
// return canArithmeticDataType(getArrayElementType(left), getArrayElementType(right))
|
||||
// }
|
||||
// if typeutil.IsArrayType(left.dataType) {
|
||||
// return canArithmeticDataType(getArrayElementType(left), right.dataType)
|
||||
// }
|
||||
// return canArithmeticDataType(left.dataType, getArrayElementType(right))
|
||||
//}
|
||||
|
||||
func canArithmetic(left, leftElement, right, rightElement schemapb.DataType) bool {
|
||||
if !typeutil.IsArrayType(left) && !typeutil.IsArrayType(right) {
|
||||
return canArithmeticDataType(left, right)
|
||||
}
|
||||
if typeutil.IsArrayType(left.dataType) && typeutil.IsArrayType(right.dataType) {
|
||||
return canArithmeticDataType(getArrayElementType(left), getArrayElementType(right))
|
||||
if typeutil.IsArrayType(left) && typeutil.IsArrayType(right) {
|
||||
return canArithmeticDataType(leftElement, rightElement)
|
||||
}
|
||||
if typeutil.IsArrayType(left.dataType) {
|
||||
return canArithmeticDataType(getArrayElementType(left), right.dataType)
|
||||
if typeutil.IsArrayType(left) {
|
||||
return canArithmeticDataType(leftElement, right)
|
||||
}
|
||||
return canArithmeticDataType(left.dataType, getArrayElementType(right))
|
||||
return canArithmeticDataType(left, rightElement)
|
||||
}
|
||||
|
||||
func canConvertToIntegerType(dataType, elementType schemapb.DataType) bool {
|
||||
return typeutil.IsIntegerType(dataType) || typeutil.IsJSONType(dataType) ||
|
||||
(typeutil.IsArrayType(dataType) && typeutil.IsIntegerType(elementType))
|
||||
}
|
||||
|
||||
func isIntegerColumn(col *planpb.ColumnInfo) bool {
|
||||
return typeutil.IsIntegerType(col.GetDataType()) ||
|
||||
(typeutil.IsArrayType(col.GetDataType()) && typeutil.IsIntegerType(col.GetElementType())) ||
|
||||
typeutil.IsJSONType(col.GetDataType())
|
||||
return canConvertToIntegerType(col.GetDataType(), col.GetElementType())
|
||||
}
|
||||
|
||||
func isEscapeCh(ch uint8) bool {
|
||||
@ -561,3 +613,103 @@ func hexDigit(n uint32) byte {
|
||||
}
|
||||
return byte(n-10) + 'a'
|
||||
}
|
||||
|
||||
func checkValidModArith(tokenType planpb.ArithOpType, leftType, leftElementType, rightType, rightElementType schemapb.DataType) error {
|
||||
switch tokenType {
|
||||
case planpb.ArithOpType_Mod:
|
||||
if !canConvertToIntegerType(leftType, leftElementType) || !canConvertToIntegerType(rightType, rightElementType) {
|
||||
return fmt.Errorf("modulo can only apply on integer types")
|
||||
}
|
||||
default:
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkRangeCompared(dataType schemapb.DataType, value *planpb.GenericValue) error {
|
||||
switch dataType {
|
||||
case schemapb.DataType_String, schemapb.DataType_VarChar:
|
||||
if !IsString(value) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
case schemapb.DataType_Bool:
|
||||
return fmt.Errorf("invalid range operations on boolean expr")
|
||||
case schemapb.DataType_Int8, schemapb.DataType_Int16, schemapb.DataType_Int32, schemapb.DataType_Int64:
|
||||
if !IsInteger(value) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
case schemapb.DataType_Float, schemapb.DataType_Double:
|
||||
if !IsNumber(value) {
|
||||
return fmt.Errorf("invalid range operations")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkContainsElement(columnExpr *ExprWithType, op planpb.JSONContainsExpr_JSONOp, elementValue *planpb.GenericValue) error {
|
||||
if op != planpb.JSONContainsExpr_Contains && elementValue.GetArrayVal() == nil {
|
||||
return fmt.Errorf("%s operation element must be an array", op.String())
|
||||
}
|
||||
|
||||
if typeutil.IsArrayType(columnExpr.expr.GetColumnExpr().GetInfo().GetDataType()) {
|
||||
var elements []*planpb.GenericValue
|
||||
if op == planpb.JSONContainsExpr_Contains {
|
||||
elements = []*planpb.GenericValue{elementValue}
|
||||
} else {
|
||||
elements = elementValue.GetArrayVal().GetArray()
|
||||
}
|
||||
for _, value := range elements {
|
||||
valExpr := toValueExpr(value)
|
||||
if !canBeCompared(columnExpr, valExpr) {
|
||||
return fmt.Errorf("%s operation can't compare between array element type: %s and %s",
|
||||
op.String(),
|
||||
columnExpr.expr.GetColumnExpr().GetInfo().GetElementType(),
|
||||
valExpr.dataType)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseJSONValue(value interface{}) (*planpb.GenericValue, schemapb.DataType, error) {
|
||||
switch v := value.(type) {
|
||||
case json.Number:
|
||||
if intValue, err := v.Int64(); err == nil {
|
||||
return NewInt(intValue), schemapb.DataType_Int64, nil
|
||||
} else if floatValue, err := v.Float64(); err == nil {
|
||||
return NewFloat(floatValue), schemapb.DataType_Double, nil
|
||||
} else {
|
||||
return nil, schemapb.DataType_None, fmt.Errorf("%v is a number, but couldn't convert it", value)
|
||||
}
|
||||
case string:
|
||||
return NewString(v), schemapb.DataType_String, nil
|
||||
case bool:
|
||||
return NewBool(v), schemapb.DataType_Bool, nil
|
||||
case []interface{}:
|
||||
arrayElements := make([]*planpb.GenericValue, len(v))
|
||||
dataType := schemapb.DataType_None
|
||||
sameType := true
|
||||
for i, elem := range v {
|
||||
ev, dt, err := parseJSONValue(elem)
|
||||
if err != nil {
|
||||
return nil, schemapb.DataType_None, err
|
||||
}
|
||||
if dataType == schemapb.DataType_None {
|
||||
dataType = dt
|
||||
} else if dataType != dt {
|
||||
sameType = false
|
||||
}
|
||||
arrayElements[i] = ev
|
||||
}
|
||||
return &planpb.GenericValue{
|
||||
Val: &planpb.GenericValue_ArrayVal{
|
||||
ArrayVal: &planpb.Array{
|
||||
Array: arrayElements,
|
||||
SameType: sameType,
|
||||
ElementType: dataType,
|
||||
},
|
||||
},
|
||||
}, schemapb.DataType_Array, nil
|
||||
default:
|
||||
return nil, schemapb.DataType_None, fmt.Errorf("%v is of unknown type: %T\n", value, v)
|
||||
}
|
||||
}
|
||||
|
@ -89,12 +89,14 @@ message ExistsExpr {
|
||||
|
||||
message ValueExpr {
|
||||
GenericValue value = 1;
|
||||
string template_variable_name = 2;
|
||||
}
|
||||
|
||||
message UnaryRangeExpr {
|
||||
ColumnInfo column_info = 1;
|
||||
OpType op = 2;
|
||||
GenericValue value = 3;
|
||||
string template_variable_name = 4;
|
||||
}
|
||||
|
||||
message BinaryRangeExpr {
|
||||
@ -103,6 +105,8 @@ message BinaryRangeExpr {
|
||||
bool upper_inclusive = 3;
|
||||
GenericValue lower_value = 4;
|
||||
GenericValue upper_value = 5;
|
||||
string lower_template_variable_name = 6;
|
||||
string upper_template_variable_name = 7;
|
||||
}
|
||||
|
||||
message CallExpr {
|
||||
@ -120,6 +124,7 @@ message TermExpr {
|
||||
ColumnInfo column_info = 1;
|
||||
repeated GenericValue values = 2;
|
||||
bool is_in_field = 3;
|
||||
string template_variable_name = 4;
|
||||
}
|
||||
|
||||
message JSONContainsExpr {
|
||||
@ -137,6 +142,7 @@ message JSONContainsExpr {
|
||||
}
|
||||
JSONOp op = 3;
|
||||
bool elements_same_type = 4;
|
||||
string template_variable_name = 5;
|
||||
}
|
||||
|
||||
message UnaryExpr {
|
||||
@ -177,6 +183,8 @@ message BinaryArithOpEvalRangeExpr {
|
||||
GenericValue right_operand = 3;
|
||||
OpType op = 4;
|
||||
GenericValue value = 5;
|
||||
string operand_template_variable_name = 6;
|
||||
string value_template_variable_name = 7;
|
||||
}
|
||||
|
||||
message AlwaysTrueExpr {}
|
||||
@ -198,6 +206,7 @@ message Expr {
|
||||
JSONContainsExpr json_contains_expr = 13;
|
||||
CallExpr call_expr = 14;
|
||||
};
|
||||
bool is_template = 20;
|
||||
}
|
||||
|
||||
message VectorANNS {
|
||||
|
@ -62,6 +62,7 @@ const (
|
||||
NQKey = "nq"
|
||||
MetricTypeKey = common.MetricTypeKey
|
||||
SearchParamsKey = "params"
|
||||
ExprParamsKey = "expr_params"
|
||||
RoundDecimalKey = "round_decimal"
|
||||
OffsetKey = "offset"
|
||||
LimitKey = "limit"
|
||||
|
@ -372,7 +372,7 @@ func (dr *deleteRunner) Init(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (dr *deleteRunner) Run(ctx context.Context) error {
|
||||
plan, err := planparserv2.CreateRetrievePlan(dr.schema.schemaHelper, dr.req.GetExpr())
|
||||
plan, err := planparserv2.CreateRetrievePlan(dr.schema.schemaHelper, dr.req.GetExpr(), dr.req.GetExprTemplateValues())
|
||||
if err != nil {
|
||||
return merr.WrapErrAsInputError(merr.WrapErrParameterInvalidMsg("failed to create delete plan: %v", err))
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ func Test_getPrimaryKeysFromPlan(t *testing.T) {
|
||||
|
||||
t.Run("delete with complex pk expr", func(t *testing.T) {
|
||||
expr := "pk < 4"
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
isSimple, _, _ := getPrimaryKeysFromPlan(collSchema, plan)
|
||||
assert.False(t, isSimple)
|
||||
@ -61,7 +61,7 @@ func Test_getPrimaryKeysFromPlan(t *testing.T) {
|
||||
|
||||
t.Run("delete with no-pk field expr", func(t *testing.T) {
|
||||
expr := "non_pk == 1"
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
isSimple, _, _ := getPrimaryKeysFromPlan(collSchema, plan)
|
||||
assert.False(t, isSimple)
|
||||
@ -69,7 +69,7 @@ func Test_getPrimaryKeysFromPlan(t *testing.T) {
|
||||
|
||||
t.Run("delete with simple term expr", func(t *testing.T) {
|
||||
expr := "pk in [1, 2, 3]"
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
isSimple, _, rowNum := getPrimaryKeysFromPlan(collSchema, plan)
|
||||
assert.True(t, isSimple)
|
||||
@ -78,7 +78,7 @@ func Test_getPrimaryKeysFromPlan(t *testing.T) {
|
||||
|
||||
t.Run("delete failed with simple term expr", func(t *testing.T) {
|
||||
expr := "pk in [1, 2, 3]"
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
termExpr := plan.Node.(*planpb.PlanNode_Query).Query.Predicates.Expr.(*planpb.Expr_TermExpr)
|
||||
termExpr.TermExpr.ColumnInfo.DataType = -1
|
||||
@ -89,7 +89,7 @@ func Test_getPrimaryKeysFromPlan(t *testing.T) {
|
||||
|
||||
t.Run("delete with simple equal expr", func(t *testing.T) {
|
||||
expr := "pk == 1"
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
isSimple, _, rowNum := getPrimaryKeysFromPlan(collSchema, plan)
|
||||
assert.True(t, isSimple)
|
||||
@ -98,7 +98,7 @@ func Test_getPrimaryKeysFromPlan(t *testing.T) {
|
||||
|
||||
t.Run("delete failed with simple equal expr", func(t *testing.T) {
|
||||
expr := "pk == 1"
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schema, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
unaryRangeExpr := plan.Node.(*planpb.PlanNode_Query).Query.Predicates.Expr.(*planpb.Expr_UnaryRangeExpr)
|
||||
unaryRangeExpr.UnaryRangeExpr.ColumnInfo.DataType = -1
|
||||
@ -1054,7 +1054,7 @@ func TestDeleteRunner_StreamingQueryAndDelteFunc(t *testing.T) {
|
||||
|
||||
schemaHelper, err := typeutil.CreateSchemaHelper(dr.schema.CollectionSchema)
|
||||
require.NoError(t, err)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schemaHelper, dr.req.Expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schemaHelper, dr.req.Expr, nil)
|
||||
assert.NoError(t, err)
|
||||
queryFunc := dr.getStreamingQueryAndDelteFunc(plan)
|
||||
assert.Error(t, queryFunc(ctx, 1, qn, ""))
|
||||
@ -1099,7 +1099,7 @@ func TestDeleteRunner_StreamingQueryAndDelteFunc(t *testing.T) {
|
||||
|
||||
schemaHelper, err := typeutil.CreateSchemaHelper(dr.schema.CollectionSchema)
|
||||
require.NoError(t, err)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schemaHelper, dr.req.Expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schemaHelper, dr.req.Expr, nil)
|
||||
assert.NoError(t, err)
|
||||
queryFunc := dr.getStreamingQueryAndDelteFunc(plan)
|
||||
assert.Error(t, queryFunc(ctx, 1, qn, ""))
|
||||
|
@ -212,7 +212,7 @@ func matchCountRule(outputs []string) bool {
|
||||
return len(outputs) == 1 && strings.ToLower(strings.TrimSpace(outputs[0])) == "count(*)"
|
||||
}
|
||||
|
||||
func createCntPlan(expr string, schemaHelper *typeutil.SchemaHelper) (*planpb.PlanNode, error) {
|
||||
func createCntPlan(expr string, schemaHelper *typeutil.SchemaHelper, exprTemplateValues map[string]*schemapb.TemplateValue) (*planpb.PlanNode, error) {
|
||||
if expr == "" {
|
||||
return &planpb.PlanNode{
|
||||
Node: &planpb.PlanNode_Query{
|
||||
@ -223,8 +223,7 @@ func createCntPlan(expr string, schemaHelper *typeutil.SchemaHelper) (*planpb.Pl
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
plan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr)
|
||||
plan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr, exprTemplateValues)
|
||||
if err != nil {
|
||||
return nil, merr.WrapErrAsInputError(merr.WrapErrParameterInvalidMsg("failed to create query plan: %v", err))
|
||||
}
|
||||
@ -240,14 +239,14 @@ func (t *queryTask) createPlan(ctx context.Context) error {
|
||||
cntMatch := matchCountRule(t.request.GetOutputFields())
|
||||
if cntMatch {
|
||||
var err error
|
||||
t.plan, err = createCntPlan(t.request.GetExpr(), schema.schemaHelper)
|
||||
t.plan, err = createCntPlan(t.request.GetExpr(), schema.schemaHelper, t.request.GetExprTemplateValues())
|
||||
t.userOutputFields = []string{"count(*)"}
|
||||
return err
|
||||
}
|
||||
|
||||
var err error
|
||||
if t.plan == nil {
|
||||
t.plan, err = planparserv2.CreateRetrievePlan(schema.schemaHelper, t.request.Expr)
|
||||
t.plan, err = planparserv2.CreateRetrievePlan(schema.schemaHelper, t.request.Expr, t.request.GetExprTemplateValues())
|
||||
if err != nil {
|
||||
return merr.WrapErrAsInputError(merr.WrapErrParameterInvalidMsg("failed to create query plan: %v", err))
|
||||
}
|
||||
|
@ -1042,7 +1042,7 @@ func Test_matchCountRule(t *testing.T) {
|
||||
|
||||
func Test_createCntPlan(t *testing.T) {
|
||||
t.Run("plan without filter", func(t *testing.T) {
|
||||
plan, err := createCntPlan("", nil)
|
||||
plan, err := createCntPlan("", nil, nil)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, plan.GetQuery().GetIsCount())
|
||||
assert.Nil(t, plan.GetQuery().GetPredicates())
|
||||
@ -1061,7 +1061,7 @@ func Test_createCntPlan(t *testing.T) {
|
||||
}
|
||||
schemaHelper, err := typeutil.CreateSchemaHelper(schema)
|
||||
require.NoError(t, err)
|
||||
plan, err := createCntPlan("a > 4", schemaHelper)
|
||||
plan, err := createCntPlan("a > 4", schemaHelper, nil)
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, plan.GetQuery().GetIsCount())
|
||||
assert.NotNil(t, plan.GetQuery().GetPredicates())
|
||||
|
@ -359,7 +359,7 @@ func (t *searchTask) initAdvancedSearchRequest(ctx context.Context) error {
|
||||
t.SearchRequest.SubReqs = make([]*internalpb.SubSearchRequest, len(t.request.GetSubReqs()))
|
||||
t.queryInfos = make([]*planpb.QueryInfo, len(t.request.GetSubReqs()))
|
||||
for index, subReq := range t.request.GetSubReqs() {
|
||||
plan, queryInfo, offset, _, err := t.tryGeneratePlan(subReq.GetSearchParams(), subReq.GetDsl())
|
||||
plan, queryInfo, offset, _, err := t.tryGeneratePlan(subReq.GetSearchParams(), subReq.GetDsl(), subReq.GetExprTemplateValues())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -452,7 +452,7 @@ func (t *searchTask) initSearchRequest(ctx context.Context) error {
|
||||
log := log.Ctx(ctx).With(zap.Int64("collID", t.GetCollectionID()), zap.String("collName", t.collectionName))
|
||||
// fetch search_growing from search param
|
||||
|
||||
plan, queryInfo, offset, isIterator, err := t.tryGeneratePlan(t.request.GetSearchParams(), t.request.GetDsl())
|
||||
plan, queryInfo, offset, isIterator, err := t.tryGeneratePlan(t.request.GetSearchParams(), t.request.GetDsl(), t.request.GetExprTemplateValues())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -501,7 +501,7 @@ func (t *searchTask) initSearchRequest(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *searchTask) tryGeneratePlan(params []*commonpb.KeyValuePair, dsl string) (*planpb.PlanNode, *planpb.QueryInfo, int64, bool, error) {
|
||||
func (t *searchTask) tryGeneratePlan(params []*commonpb.KeyValuePair, dsl string, exprTemplateValues map[string]*schemapb.TemplateValue) (*planpb.PlanNode, *planpb.QueryInfo, int64, bool, error) {
|
||||
annsFieldName, err := funcutil.GetAttrByKeyFromRepeatedKV(AnnsFieldKey, params)
|
||||
if err != nil || len(annsFieldName) == 0 {
|
||||
vecFields := typeutil.GetVectorFieldSchemas(t.schema.CollectionSchema)
|
||||
@ -524,7 +524,7 @@ func (t *searchTask) tryGeneratePlan(params []*commonpb.KeyValuePair, dsl string
|
||||
}
|
||||
|
||||
searchInfo.planInfo.QueryFieldId = annField.GetFieldID()
|
||||
plan, planErr := planparserv2.CreateSearchPlan(t.schema.schemaHelper, dsl, annsFieldName, searchInfo.planInfo)
|
||||
plan, planErr := planparserv2.CreateSearchPlan(t.schema.schemaHelper, dsl, annsFieldName, searchInfo.planInfo, exprTemplateValues)
|
||||
if planErr != nil {
|
||||
log.Warn("failed to create query plan", zap.Error(planErr),
|
||||
zap.String("dsl", dsl), // may be very large if large term passed.
|
||||
|
@ -232,7 +232,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age==156"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -249,7 +249,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age!=156"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -266,7 +266,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age in [100,200,300]"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -284,7 +284,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age not in [100,200,300]"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -301,7 +301,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age>=700"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -317,7 +317,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age>=500 and age<=550"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -333,7 +333,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "500<=age<=550"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -350,7 +350,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "(age>=500 and age<=550) or (age>800 and age<950) or (age>300 and age<330)"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -368,7 +368,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "(age>=500 and age<=550) or (age>800 and age<950) or (age>300 and age<330) or age < 150"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -386,7 +386,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age > 600 or age < 300"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -404,7 +404,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarIntField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "age > 600 or age < 30"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -429,7 +429,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithUnrelatedField() {
|
||||
exprStr := "age>=500 and age<=550 and info != 'xxx'"
|
||||
// as info is not cluster key field, so 'and' one more info condition will not influence the pruned result
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -447,7 +447,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithUnrelatedField() {
|
||||
exprStr := "age>=500 and info != 'xxx' and age<=550"
|
||||
// as info is not cluster key field, so 'and' one more info condition will not influence the pruned result
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -465,7 +465,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithUnrelatedField() {
|
||||
exprStr := "age>=500 and age<=550 or info != 'xxx'"
|
||||
// as info is not cluster key field, so 'or' one more will make it impossible to prune any segments
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -484,7 +484,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithUnrelatedField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "(age>=500 and age<=550) or info != 'xxx' or (age>800 and age<950) or (age>300 and age<330) or age < 50"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -503,7 +503,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithUnrelatedField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "(age>=500 and age<=550) and info != 'xxx' or (age>800 and age<950) or (age>300 and age<330) or age < 50"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -520,7 +520,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithUnrelatedField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := "info in ['aa','bb','cc']"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -544,7 +544,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarStrField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := `info=="rag"`
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -562,7 +562,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarStrField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := `info=="kpl"`
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -580,7 +580,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsByScalarStrField() {
|
||||
copy(testSegments, sps.sealedSegments)
|
||||
exprStr := `info<="less"`
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(sps.schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -765,7 +765,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int8 > 128"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -781,7 +781,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int8 < -129"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -797,7 +797,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int8 > 50"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -914,7 +914,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int16 > 32768"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -930,7 +930,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int16 < -32769"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -945,7 +945,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int16 > 2550"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1063,7 +1063,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int32 > 2147483648"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1079,7 +1079,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int32 < -2147483649"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1095,7 +1095,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsVariousIntTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "int32 > 12550"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1230,7 +1230,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsFloatTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "float > 3.5"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1347,7 +1347,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsFloatTypes() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "double < -1.5"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1421,7 +1421,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithoutPartitionStats() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "double < -1.5"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1441,7 +1441,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithoutPartitionStats() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "double < -1.5"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1459,7 +1459,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithoutPartitionStats() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "double < -1.5"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
@ -1537,7 +1537,7 @@ func (sps *SegmentPrunerSuite) TestPruneSegmentsWithoutPartitionStats() {
|
||||
copy(testSegments, sealedSegments)
|
||||
exprStr := "double < -1.5"
|
||||
schemaHelper, _ := typeutil.CreateSchemaHelper(schema)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr)
|
||||
planNode, err := planparserv2.CreateRetrievePlan(schemaHelper, exprStr, nil)
|
||||
sps.NoError(err)
|
||||
serializedPlan, _ := proto.Marshal(planNode)
|
||||
queryReq := &internalpb.RetrieveRequest{
|
||||
|
@ -117,7 +117,7 @@ func TestParsePartitionKeys(t *testing.T) {
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
// test search plan
|
||||
searchPlan, err := planparserv2.CreateSearchPlan(schemaHelper, tc.expr, "fvec_field", queryInfo)
|
||||
searchPlan, err := planparserv2.CreateSearchPlan(schemaHelper, tc.expr, "fvec_field", queryInfo, nil)
|
||||
assert.NoError(t, err)
|
||||
expr, err := ParseExprFromPlan(searchPlan)
|
||||
assert.NoError(t, err)
|
||||
@ -130,7 +130,7 @@ func TestParsePartitionKeys(t *testing.T) {
|
||||
}
|
||||
|
||||
// test query plan
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, tc.expr)
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, tc.expr, nil)
|
||||
assert.NoError(t, err)
|
||||
expr, err = ParseExprFromPlan(queryPlan)
|
||||
assert.NoError(t, err)
|
||||
@ -173,7 +173,7 @@ func TestParseIntRanges(t *testing.T) {
|
||||
// test query plan
|
||||
{
|
||||
expr := "cluster_key_field > 50"
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr)
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
planExpr, err := ParseExprFromPlan(queryPlan)
|
||||
assert.NoError(t, err)
|
||||
@ -190,7 +190,7 @@ func TestParseIntRanges(t *testing.T) {
|
||||
// test binary query plan
|
||||
{
|
||||
expr := "cluster_key_field > 50 and cluster_key_field <= 100"
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr)
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
planExpr, err := ParseExprFromPlan(queryPlan)
|
||||
assert.NoError(t, err)
|
||||
@ -206,7 +206,7 @@ func TestParseIntRanges(t *testing.T) {
|
||||
// test binary query plan
|
||||
{
|
||||
expr := "cluster_key_field >= 50 and cluster_key_field < 100"
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr)
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
planExpr, err := ParseExprFromPlan(queryPlan)
|
||||
assert.NoError(t, err)
|
||||
@ -222,7 +222,7 @@ func TestParseIntRanges(t *testing.T) {
|
||||
// test binary query plan
|
||||
{
|
||||
expr := "cluster_key_field in [100]"
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr)
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
planExpr, err := ParseExprFromPlan(queryPlan)
|
||||
assert.NoError(t, err)
|
||||
@ -264,7 +264,7 @@ func TestParseStrRanges(t *testing.T) {
|
||||
// test query plan
|
||||
{
|
||||
expr := "cluster_key_field >= \"aaa\""
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr)
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, expr, nil)
|
||||
assert.NoError(t, err)
|
||||
planExpr, err := ParseExprFromPlan(queryPlan)
|
||||
assert.NoError(t, err)
|
||||
@ -477,7 +477,7 @@ func TestValidatePartitionKeyIsolation(t *testing.T) {
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, tc.expr)
|
||||
queryPlan, err := planparserv2.CreateRetrievePlan(schemaHelper, tc.expr, nil)
|
||||
assert.NoError(t, err)
|
||||
planExpr, err := ParseExprFromPlan(queryPlan)
|
||||
assert.NoError(t, err)
|
||||
|
@ -149,8 +149,8 @@ var InvalidExpressions = []InvalidExprStruct{
|
||||
{Expr: fmt.Sprintf("%s[0] == [2, 3]", DefaultJSONFieldName), ErrNil: true, ErrMsg: ""}, // field exist but type not match
|
||||
{Expr: fmt.Sprintf("json_contains (%s['number'], 2)", DefaultJSONFieldName), ErrNil: true, ErrMsg: ""},
|
||||
{Expr: fmt.Sprintf("json_contains (%s['list'], [2])", DefaultJSONFieldName), ErrNil: true, ErrMsg: ""},
|
||||
{Expr: fmt.Sprintf("json_contains_all (%s['list'], 2)", DefaultJSONFieldName), ErrNil: false, ErrMsg: "contains_all operation element must be an array"},
|
||||
{Expr: fmt.Sprintf("JSON_CONTAINS_ANY (%s['list'], 2)", DefaultJSONFieldName), ErrNil: false, ErrMsg: "contains_any operation element must be an array"},
|
||||
{Expr: fmt.Sprintf("json_contains_all (%s['list'], 2)", DefaultJSONFieldName), ErrNil: false, ErrMsg: "operation element must be an array"},
|
||||
{Expr: fmt.Sprintf("JSON_CONTAINS_ANY (%s['list'], 2)", DefaultJSONFieldName), ErrNil: false, ErrMsg: "operation element must be an array"},
|
||||
{Expr: fmt.Sprintf("json_contains_aby (%s['list'], 2)", DefaultJSONFieldName), ErrNil: false, ErrMsg: "function json_contains_aby(json, int64_t) not found."},
|
||||
{Expr: fmt.Sprintf("json_contains_aby (%s['list'], 2)", DefaultJSONFieldName), ErrNil: false, ErrMsg: "function json_contains_aby(json, int64_t) not found."},
|
||||
{Expr: fmt.Sprintf("%s[-1] > %d", DefaultInt8ArrayField, TestCapacity), ErrNil: false, ErrMsg: "cannot parse expression"}, // array[-1] >
|
||||
|
Loading…
Reference in New Issue
Block a user