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

Function metadataPrunerPred

compiler/optimizer/pruner.go:308–326  ·  view source on GitHub ↗
(op string, this *dag.ThisExpr, literal *dag.PrimitiveExpr)

Source from the content-addressed store, hash-verified

306}
307
308func metadataPrunerPred(op string, this *dag.ThisExpr, literal *dag.PrimitiveExpr) *dag.BinaryExpr {
309 min := dag.NewThis(append(slices.Clone(this.Path), "min"))
310 max := dag.NewThis(append(slices.Clone(this.Path), "max"))
311 switch op {
312 case "<":
313 return compare("<", min, literal)
314 case "<=":
315 return compare("<=", min, literal)
316 case ">":
317 return compare(">", max, literal)
318 case ">=":
319 return compare(">=", max, literal)
320 case "==":
321 return dag.NewBinaryExpr("and",
322 compare(">=", literal, min),
323 compare("<=", literal, max))
324 }
325 panic("metadataPrunerPred unknown op " + op)
326}

Callers 1

metaPrunerBinaryExprFunction · 0.85

Calls 4

NewThisFunction · 0.92
NewBinaryExprFunction · 0.92
compareFunction · 0.85
CloneMethod · 0.65

Tested by

no test coverage detected