github.com/cockroachdb/cockroachdb-parser@v0.23.3-0.20240213214944-911057d40c9a/pkg/sql/inverted/span_expression.proto (about) 1 // Copyright 2020 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 syntax = "proto3"; 12 package cockroach.sql.inverted; 13 option go_package = "github.com/cockroachdb/cockroach/pkg/sql/inverted"; 14 15 import "gogoproto/gogo.proto"; 16 17 // SetOperator is an operator on sets. 18 enum SetOperator { 19 option (gogoproto.goproto_enum_prefix) = false; 20 21 // None is used in an expression node with no children. 22 None = 0; 23 24 // SetUnion unions the children. 25 SetUnion = 1; 26 27 // SetIntersection intersects the children. 28 SetIntersection = 2; 29 } 30 31 // SpanExpressionProto is a proto representation of an inverted.Expression 32 // tree consisting only of SpanExpressions. It is intended for use in 33 // expression execution. 34 message SpanExpressionProto { 35 // Span is a span of the inverted index. Represents [start, end). 36 message Span { 37 bytes start = 1; 38 bytes end = 2; 39 } 40 message Node { 41 repeated Span factored_union_spans = 1 [(gogoproto.nullable) = false]; 42 SetOperator operator = 2; 43 Node left = 3; 44 Node right = 4; 45 } 46 repeated Span spans_to_read = 1 [(gogoproto.nullable) = false]; 47 Node node = 2 [(gogoproto.nullable) = false]; 48 }