milvus/internal/parser/planparserv2/check_identical.go
Jiquan Long 98ceb162aa
Support antlr as plan parser (#16696)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>

Co-authored-by: xaxys <tpnnghd@163.com>

Co-authored-by: xaxys <tpnnghd@163.com>
2022-05-06 17:43:51 +08:00

16 lines
322 B
Go

package planparserv2
import (
"reflect"
"github.com/milvus-io/milvus/internal/proto/planpb"
)
// CheckIdentical check if two exprs are identical.
func CheckIdentical(expr, other *planpb.Expr) bool {
v := NewShowExprVisitor()
js1 := v.VisitExpr(expr)
js2 := v.VisitExpr(other)
return reflect.DeepEqual(js1, js2)
}