mirror of https://github.com/milvus-io/milvus.git
Bool expr not support numerica (#12184)
Signed-off-by: fishpenguin <kun.yu@zilliz.com>pull/12184/merge
parent
01be91116e
commit
adf9530ed7
|
@ -567,17 +567,6 @@ func (pc *parserContext) handleLeafValue(nodeRaw *ant_ast.Node, dataType schemap
|
|||
Int64Val: int64(node.Value),
|
||||
},
|
||||
}
|
||||
} else if dataType == schemapb.DataType_Bool {
|
||||
gv = &planpb.GenericValue{
|
||||
Val: &planpb.GenericValue_BoolVal{},
|
||||
}
|
||||
if node.Value == 1 {
|
||||
gv.Val.(*planpb.GenericValue_BoolVal).BoolVal = true
|
||||
} else if node.Value == 0 {
|
||||
gv.Val.(*planpb.GenericValue_BoolVal).BoolVal = false
|
||||
} else {
|
||||
return nil, fmt.Errorf("bool field should only match 0 or 1")
|
||||
}
|
||||
} else {
|
||||
return nil, fmt.Errorf("type mismatch")
|
||||
}
|
||||
|
|
|
@ -250,12 +250,11 @@ func TestExprMultiRange_Str(t *testing.T) {
|
|||
"BoolN1 == True",
|
||||
"True == BoolN1",
|
||||
"BoolN1 == False",
|
||||
"BoolN1 == 1",
|
||||
"BoolN1 == 0",
|
||||
}
|
||||
invalidExprs := []string{
|
||||
"BoolN1 == 2",
|
||||
"BoolN1 > 2",
|
||||
"BoolN1 == 1",
|
||||
"BoolN1 == 0",
|
||||
"BoolN1 > 0",
|
||||
}
|
||||
|
||||
fields := []*schemapb.FieldSchema{
|
||||
|
|
Loading…
Reference in New Issue