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

Function ExprForSpan

pkg/sql/inverted/expression.go:519–525  ·  view source on GitHub ↗

ExprForSpan constructs a leaf-level SpanExpression for an inverted expression. Note that these leaf-level expressions may also have tight = false. Geospatial functions are all non-tight. For JSON, expressions like x <@ '{"a":1, "b":2}'::json will have tight = false. Say SpanA, SpanB correspond to "

(span Span, tight bool)

Source from the content-addressed store, hash-verified

517// be very wide when SpanA and SpanB are narrow, or vice versa,
518// this tight expression would be very costly to evaluate.
519func ExprForSpan(span Span, tight bool) *SpanExpression {
520 return &SpanExpression{
521 Tight: tight,
522 SpansToRead: []Span{span},
523 FactoredUnionSpans: []Span{span},
524 }
525}
526
527// ContainsKeys traverses the SpanExpression to determine whether the span
528// expression contains the given keys. It is primarily used for testing.

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…