MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / opSpanExpressionAndDefault

Function opSpanExpressionAndDefault

pkg/sql/inverted/expression.go:642–663  ·  view source on GitHub ↗

Helper that applies op to a left-side that is a *SpanExpression and a right-side that is an unknown implementation of Expression.

(
	left *SpanExpression, right Expression, op SetOperator,
)

Source from the content-addressed store, hash-verified

640// Helper that applies op to a left-side that is a *SpanExpression and
641// a right-side that is an unknown implementation of Expression.
642func opSpanExpressionAndDefault(
643 left *SpanExpression, right Expression, op SetOperator,
644) *SpanExpression {
645 expr := &SpanExpression{
646 Tight: left.IsTight() && right.IsTight(),
647 // The SpansToRead is a lower-bound in this case. Note that
648 // such an expression is only used for Join costing.
649 SpansToRead: left.SpansToRead,
650 Operator: op,
651 Left: left,
652 Right: right,
653 }
654 if op == SetUnion {
655 // Promote the left-side union spans. We don't know anything
656 // about the right-side.
657 expr.FactoredUnionSpans = left.FactoredUnionSpans
658 left.FactoredUnionSpans = nil
659 }
660 // Else SetIntersection -- we can't factor anything if one side is
661 // unknown.
662 return expr
663}
664
665// Intersects two SpanExpressions.
666func intersectSpanExpressions(left, right *SpanExpression) *SpanExpression {

Callers 2

AndFunction · 0.85
OrFunction · 0.85

Calls 1

IsTightMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…