Esempio n. 1
0
func newSargableUnary(pred expression.UnaryFunction) *sargableUnary {
	rv := &sargableUnary{}
	rv.test = func(expr2 expression.Expression) (bool, error) {
		return SubsetOf(pred, expr2) ||
			pred.Operand().EquivalentTo(expr2), nil
	}

	return rv
}
Esempio n. 2
0
func newSargValued(pred expression.UnaryFunction) *sargValued {
	rv := &sargValued{}
	rv.sarger = func(expr2 expression.Expression) (plan.Spans, error) {
		if SubsetOf(pred, expr2) {
			return _SELF_SPANS, nil
		}

		if pred.Operand().EquivalentTo(expr2) {
			return _VALUED_SPANS, nil
		}

		return nil, nil
	}

	return rv
}