MCPcopy Create free account
hub / github.com/brimdata/super / compare

Function compare

compiler/optimizer/pruner.go:116–120  ·  view source on GitHub ↗

compare returns a DAG expression for a standard comparison operator but uses a call to the SuperSQL function "compare()" as standard comparisons do not handle nullsmax or cross-type comparisons (which can arise when the pool key value type changes).

(op string, lhs, rhs dag.Expr)

Source from the content-addressed store, hash-verified

114// do not handle nullsmax or cross-type comparisons (which can arise when the
115// pool key value type changes).
116func compare(op string, lhs, rhs dag.Expr) *dag.BinaryExpr {
117 nullsMax := &dag.PrimitiveExpr{Kind: "PrimitiveExpr", Value: "true"}
118 call := dag.NewCall("compare", []dag.Expr{lhs, rhs, nullsMax})
119 return dag.NewBinaryExpr(op, call, &dag.PrimitiveExpr{Kind: "PrimitiveExpr", Value: "0"})
120}
121
122func literalComparison(e *dag.BinaryExpr) (*dag.ThisExpr, *dag.PrimitiveExpr, string) {
123 switch lhs := e.LHS.(type) {

Callers 9

rangePrunerPredFunction · 0.85
newMetadataPrunerFunction · 0.85
metadataPrunerPredFunction · 0.85
CompareBoolFunction · 0.85
CompareIPFunction · 0.85
CompareFloat64Function · 0.85
CompareStringFunction · 0.85
CompareBytesFunction · 0.85
ContainsFunction · 0.85

Calls 2

NewCallFunction · 0.92
NewBinaryExprFunction · 0.92

Tested by

no test coverage detected