github.com/matrixorigin/matrixone@v0.7.0/proto/pipeline.proto (about) 1 /* 2 * Copyright 2021 Matrix Origin 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 syntax = "proto3"; 18 package pipeline; 19 20 import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 21 option go_package = "github.com/matrixorigin/matrixone/pkg/pb/pipeline"; 22 option (gogoproto.sizer_all) = false; 23 option (gogoproto.protosizer_all) = true; 24 25 import "plan.proto"; 26 import "timestamp.proto"; 27 28 message Message { 29 uint64 sid = 1; 30 uint64 cmd = 2; 31 bytes err = 3; 32 bytes data = 4; 33 bytes proc_info_data = 5; 34 bytes analyse = 6; 35 uint64 id = 7; 36 bytes uuid = 8; 37 uint64 batch_cnt = 9; 38 uint32 checksum = 10; 39 uint64 sequence = 11; 40 } 41 42 message Connector { 43 int32 pipeline_id = 1; 44 int32 connector_index = 2; 45 } 46 47 message Dispatch { 48 int32 func_id = 1; 49 repeated Connector local_connector = 2; 50 repeated WrapNode remote_connector = 3; 51 } 52 53 message Aggregate { 54 int32 op = 1; 55 bool dist = 2; 56 plan.Expr expr = 3; 57 } 58 59 message Group { 60 bool need_eval = 1; 61 uint64 ibucket = 2; 62 uint64 nbucket = 3; 63 repeated plan.Expr exprs = 4; 64 repeated plan.Type types = 5; 65 repeated Aggregate aggs = 6; 66 } 67 68 message Insert{ 69 uint64 affected = 1; 70 bool IsRemote = 2; 71 72 // InsertCtx 73 repeated int32 idx = 3; 74 plan.ObjectRef ref = 4; 75 plan.TableDef table_def = 5; 76 repeated int32 idx_idx = 6; 77 map<string, int32> parent_idx = 7; 78 plan.ClusterTable ClusterTable = 8; 79 } 80 81 message Join { 82 uint64 ibucket = 1; 83 uint64 nbucket = 2; 84 repeated int32 rel_list = 3; 85 repeated int32 col_list = 4; 86 plan.Expr expr = 5; 87 repeated plan.Type types = 6; 88 repeated plan.Expr left_cond = 7; 89 repeated plan.Expr right_cond = 8; 90 } 91 92 message AntiJoin{ 93 uint64 ibucket = 1; 94 uint64 nbucket = 2; 95 repeated int32 result = 3; 96 plan.Expr expr = 4; 97 repeated plan.Type types = 5; 98 repeated plan.Expr left_cond = 6; 99 repeated plan.Expr right_cond = 7; 100 } 101 102 message InnerJoin { 103 uint64 ibucket = 1; 104 uint64 nbucket = 2; 105 repeated int32 rel_list = 3; 106 repeated int32 col_list = 4; 107 plan.Expr expr = 5; 108 repeated plan.Type types = 6; 109 repeated plan.Expr left_cond = 7; 110 repeated plan.Expr right_cond = 8; 111 } 112 113 message LeftJoin { 114 uint64 ibucket = 1; 115 uint64 nbucket = 2; 116 repeated int32 rel_list = 3; 117 repeated int32 col_list = 4; 118 plan.Expr expr = 5; 119 repeated plan.Type types = 6; 120 repeated plan.Expr left_cond = 7; 121 repeated plan.Expr right_cond = 8; 122 } 123 124 message SemiJoin { 125 uint64 ibucket = 1; 126 uint64 nbucket = 2; 127 repeated int32 result = 3; 128 plan.Expr expr = 4; 129 repeated plan.Type types = 5; 130 repeated plan.Expr left_cond = 6; 131 repeated plan.Expr right_cond = 7; 132 } 133 134 message SingleJoin { 135 uint64 ibucket = 1; 136 uint64 nbucket = 2; 137 repeated int32 rel_list = 3; 138 repeated int32 col_list = 4; 139 plan.Expr expr = 5; 140 repeated plan.Type types = 6; 141 repeated plan.Expr left_cond = 7; 142 repeated plan.Expr right_cond = 8; 143 } 144 145 message MarkJoin { 146 uint64 ibucket = 1; 147 uint64 nbucket = 2; 148 repeated int32 result = 3; 149 plan.Expr expr = 4; 150 repeated plan.Type types = 5; 151 repeated plan.Expr left_cond = 6; 152 repeated plan.Expr right_cond = 7; 153 repeated plan.Expr on_list = 8; 154 } 155 156 message Product { 157 repeated int32 rel_list = 1; 158 repeated int32 col_list = 2; 159 repeated plan.Type types = 3; 160 } 161 162 message TableFunction { 163 repeated string attrs = 1; 164 repeated plan.ColDef rets = 2; 165 repeated plan.Expr args = 3; 166 bytes params = 4; 167 string name = 5; 168 } 169 170 message HashBuild { 171 bool need_expr = 1; 172 bool need_hash = 2; 173 uint64 ibucket = 3; 174 uint64 nbucket = 4; 175 repeated plan.Type types = 5; 176 repeated plan.Expr conds = 6; 177 } 178 179 message ExternalName2ColIndex { 180 string name = 1; 181 int32 index = 2; 182 } 183 184 message ExternalScan { 185 repeated string attrs = 1; 186 repeated plan.ColDef cols = 2; 187 repeated ExternalName2ColIndex name2_col_index = 3; 188 string create_sql = 4; 189 repeated string file_list = 5; 190 repeated plan.ColDef origin_cols = 6; 191 } 192 193 message Instruction{ 194 // Op specified the operator code of an instruction. 195 int32 op = 1; 196 // Idx specified the anaylze information index. 197 int32 idx = 2; 198 AntiJoin anti = 3; 199 Connector connect = 4; 200 Dispatch dispatch = 5; 201 Group agg = 6; 202 InnerJoin inner_join = 7; 203 LeftJoin left_join = 8; 204 SemiJoin semi_join = 9; 205 SingleJoin single_join = 10; 206 MarkJoin mark_join = 11; 207 Join join = 12; 208 Product product = 13; 209 TableFunction table_function = 14; 210 HashBuild hash_build = 15; 211 ExternalScan external_scan = 16; 212 Insert insert = 17; 213 repeated plan.OrderBySpec order_by = 18; 214 repeated plan.Expr project_list = 19; 215 plan.Expr filter = 20; 216 uint64 limit = 21; 217 uint64 offset = 22; 218 // isFirst identifies whether it is the first instruction of analyzeInfo corresponding to idx 219 bool isFirst = 23; 220 // isLast identifies whether it is the last instruction of analyzeInfo corresponding to idx 221 bool isLast = 24; 222 } 223 224 message AnalysisList { 225 repeated plan.AnalyzeInfo list = 1; 226 } 227 228 message Source { 229 string schema_name = 1; 230 string table_name = 2; 231 repeated string col_list = 3; 232 string block = 4; 233 uint64 pushdown_id = 5; 234 string pushdown_addr = 6; 235 plan.Expr expr = 7; 236 plan.TableDef tableDef = 8; 237 timestamp.Timestamp timestamp = 9; 238 } 239 240 message NodeInfo { 241 int32 mcpu = 1; 242 string id = 2; 243 string addr = 3; 244 repeated string payload = 4; 245 } 246 247 message ProcessLimitation { 248 int64 size = 1; 249 int64 batch_rows = 2; 250 int64 batch_size = 3; 251 int64 partition_rows = 4; 252 int64 reader_size = 5; 253 } 254 255 message ProcessInfo { 256 string id = 1; 257 ProcessLimitation lim = 2; 258 int64 unix_time = 3; 259 string snapshot = 4; 260 SessionInfo session_info = 5; 261 repeated int32 analysis_node_list = 6; 262 } 263 264 message SessionInfo { 265 string user = 1; 266 string host = 2; 267 string role = 3; 268 uint64 connection_id = 4; 269 string database = 5; 270 string version = 6; 271 bytes time_zone = 7; 272 string account = 8; 273 } 274 275 message Pipeline { 276 enum PipelineType{ 277 Merge = 0; 278 Normal = 1; 279 Remote = 2; 280 Parallel = 3; 281 } 282 283 PipelineType pipeline_type = 1; 284 int32 pipeline_id = 2; 285 plan.Plan qry = 3; 286 Source data_source = 4; 287 repeated Pipeline children = 5; 288 repeated Instruction instruction_list = 6; 289 290 bool is_end = 7; 291 bool is_join = 8; 292 NodeInfo node = 9; 293 int32 push_down_info = 10; 294 int32 children_count = 11; 295 296 repeated UuidToRegIdx uuids_to_reg_idx = 12; 297 } 298 299 message WrapNode { 300 string node_addr = 1; 301 bytes uuid = 2; 302 } 303 304 message UuidToRegIdx { 305 int32 idx = 1; 306 bytes uuid = 2; 307 string from_addr = 3; 308 }