milvus/internal/parser/planparserv2/node_ret.go
SimFG d7f38a803d
Separate some proto files (#19218)
Signed-off-by: SimFG <bang.fu@zilliz.com>

Signed-off-by: SimFG <bang.fu@zilliz.com>
2022-09-16 16:56:49 +08:00

38 lines
653 B
Go

package planparserv2
import (
"github.com/milvus-io/milvus/api/schemapb"
"github.com/milvus-io/milvus/internal/proto/planpb"
)
type ExprWithType struct {
expr *planpb.Expr
dataType schemapb.DataType
}
func getError(obj interface{}) error {
err, ok := obj.(error)
if !ok {
// obj is not an error.
return nil
}
return err
}
func getExpr(obj interface{}) *ExprWithType {
n, ok := obj.(*ExprWithType)
if !ok {
// obj is not of *ExprWithType
return nil
}
return n
}
func getGenericValue(obj interface{}) *planpb.GenericValue {
expr := getExpr(obj)
if expr == nil {
return nil
}
return expr.expr.GetValueExpr().GetValue()
}