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

Function rangePrunerPred

compiler/optimizer/pruner.go:89–110  ·  view source on GitHub ↗
(op string, literal *dag.PrimitiveExpr, min, max *dag.ThisExpr)

Source from the content-addressed store, hash-verified

87}
88
89func rangePrunerPred(op string, literal *dag.PrimitiveExpr, min, max *dag.ThisExpr) *dag.BinaryExpr {
90 switch op {
91 case "<":
92 // key < CONST
93 return compare("<=", literal, min)
94 case "<=":
95 // key <= CONST
96 return compare("<", literal, min)
97 case ">":
98 // key > CONST
99 return compare(">=", literal, max)
100 case ">=":
101 // key >= CONST
102 return compare(">", literal, max)
103 case "==":
104 // key == CONST
105 return dag.NewBinaryExpr("or",
106 compare(">", min, literal),
107 compare("<", max, literal))
108 }
109 panic("rangePrunerPred unknown op " + op)
110}
111
112// compare returns a DAG expression for a standard comparison operator but
113// uses a call to the SuperSQL function "compare()" as standard comparisons

Callers 1

buildRangePrunerFunction · 0.85

Calls 2

NewBinaryExprFunction · 0.92
compareFunction · 0.85

Tested by

no test coverage detected