(op string, this *dag.ThisExpr, literal *dag.PrimitiveExpr)
| 306 | } |
| 307 | |
| 308 | func 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 | } |
no test coverage detected