github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/execinfrapb/processors_base.proto (about)

     1  // Copyright 2019 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  // Processor definitions for distributed SQL APIs. See
    12  // docs/RFCS/distributed_sql.md.
    13  // All the concepts here are "physical plan" concepts.
    14  
    15  syntax = "proto2";
    16  // Beware! This package name must not be changed, even though it doesn't match
    17  // the Go package name, because it defines the Protobuf message names which
    18  // can't be changed without breaking backward compatibility.
    19  package cockroach.sql.distsqlrun;
    20  option go_package = "execinfrapb";
    21  
    22  import "sql/execinfrapb/data.proto";
    23  import "roachpb/data.proto";
    24  import "gogoproto/gogo.proto";
    25  
    26  // PostProcessSpec describes the processing required to obtain the output
    27  // (filtering, projection). It operates on the internal schema of the processor
    28  // (see ProcessorSpec).
    29  message PostProcessSpec {
    30    // A filtering expression which references the internal columns of the
    31    // processor via ordinal references (@1, @2, etc).
    32    optional Expression filter = 1 [(gogoproto.nullable) = false];
    33  
    34    // If true, output_columns describes a projection. Used to differentiate
    35    // between an empty projection and no projection.
    36    //
    37    // Cannot be set at the same time with render expressions.
    38    optional bool projection = 2 [(gogoproto.nullable) = false];
    39  
    40    // The output columns describe a projection on the internal set of columns;
    41    // only the columns in this list will be emitted.
    42    //
    43    // Can only be set if projection is true. Cannot be set at the same time with
    44    // render expressions.
    45    repeated uint32 output_columns = 3 [packed = true];
    46  
    47    // If set, the output is the result of rendering these expressions. The
    48    // expressions reference the internal columns of the processor.
    49    //
    50    // Cannot be set at the same time with output columns.
    51    repeated Expression render_exprs = 4 [(gogoproto.nullable) = false];
    52  
    53    // If nonzero, the first <offset> rows will be suppressed.
    54    optional uint64 offset = 5 [(gogoproto.nullable) = false];
    55  
    56    // If nonzero, the processor will stop after emitting this many rows. The rows
    57    // suppressed by <offset>, if any, do not count towards this limit.
    58    optional uint64 limit = 6 [(gogoproto.nullable) = false];
    59  }
    60  
    61  message Columns {
    62    repeated uint32 columns = 1 [packed = true];
    63  }
    64  
    65  message TableReaderSpan {
    66    // TODO(radu): the dist_sql APIs should be agnostic to how we map tables to
    67    // KVs. The span should be described as starting and ending lists of values
    68    // for a prefix of the index columns, along with inclusive/exclusive flags.
    69    optional roachpb.Span span = 1 [(gogoproto.nullable) = false];
    70  }
    71