| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| |
| syntax = "proto2"; |
| |
| package quickstep.serialization; |
| |
| import "relational_operators/SortMergeRunOperator.proto"; |
| |
| enum WorkOrderType { |
| AGGREGATION = 1; |
| BUILD_HASH = 2; |
| CREATE_INDEX = 3; // Placeholder. |
| CREATE_TABLE = 4; // Placeholder. |
| DELETE = 5; |
| DESTROY_HASH = 6; |
| DROP_TABLE = 7; |
| FINALIZE_AGGREGATION = 8; |
| HASH_JOIN = 9; |
| INSERT = 10; |
| NESTED_LOOP_JOIN = 11; |
| SAMPLE = 12; |
| SAVE_BLOCKS = 13; |
| SELECT = 14; |
| SORT_MERGE_RUN = 15; |
| SORT_RUN_GENERATION = 16; |
| TABLE_GENERATOR = 17; |
| TEXT_SCAN = 18; |
| UPDATE = 19; |
| WINDOW_AGGREGATION = 20; |
| DESTROY_AGGREGATION_STATE = 21; |
| } |
| |
| message WorkOrder { |
| required WorkOrderType work_order_type = 1; |
| required uint64 query_id = 2; |
| |
| // The convention for extension numbering is that extensions for a particular |
| // WorkOrderID should begin from (operator_type + 1) * 16. |
| extensions 16 to max; |
| } |
| |
| message AggregationWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional uint32 aggr_state_index = 16; |
| optional fixed64 block_id = 17; |
| } |
| } |
| |
| message BuildHashWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional int32 relation_id = 32; |
| repeated int32 join_key_attributes = 33; |
| optional bool any_join_key_attributes_nullable = 34; |
| optional uint32 join_hash_table_index = 35; |
| optional fixed64 block_id = 36; |
| } |
| } |
| |
| message DeleteWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional uint64 operator_index = 96; |
| optional int32 relation_id = 97; |
| optional int32 predicate_index = 98; |
| optional fixed64 block_id = 99; |
| } |
| } |
| |
| message DestroyHashWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional uint32 join_hash_table_index = 112; |
| } |
| } |
| |
| message DropTableWorkOrder { |
| extend WorkOrder { |
| // If set, CatalogDatabaseCache will drop the relation. |
| optional int32 relation_id = 128; |
| // Optional, and maybe empty. |
| repeated fixed64 block_ids = 129; |
| } |
| } |
| |
| message FinalizeAggregationWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional uint32 aggr_state_index = 144; |
| optional int32 insert_destination_index = 145; |
| } |
| } |
| |
| message HashJoinWorkOrder { |
| enum HashJoinWorkOrderType { |
| HASH_ANTI_JOIN = 0; |
| HASH_INNER_JOIN = 1; |
| HASH_OUTER_JOIN = 2; |
| HASH_SEMI_JOIN = 3; |
| } |
| |
| extend WorkOrder { |
| // All required. |
| optional HashJoinWorkOrderType hash_join_work_order_type = 160; |
| optional int32 build_relation_id = 161; |
| optional int32 probe_relation_id = 162; |
| repeated int32 join_key_attributes = 163; |
| optional bool any_join_key_attributes_nullable = 164; |
| optional int32 insert_destination_index = 165; |
| optional uint32 join_hash_table_index = 166; |
| optional int32 selection_index = 167; |
| optional fixed64 block_id = 168; |
| |
| // Used by all but HashOuterJoinWorkOrder. |
| optional int32 residual_predicate_index = 169; |
| // Used by HashOuterJoinWorkOrder only. |
| repeated bool is_selection_on_build = 170; |
| } |
| } |
| |
| message InsertWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional int32 insert_destination_index = 176; |
| optional uint32 tuple_index = 177; |
| } |
| } |
| |
| message NestedLoopsJoinWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional int32 left_relation_id = 192; |
| optional int32 right_relation_id = 193; |
| optional fixed64 left_block_id = 194; |
| optional fixed64 right_block_id = 195; |
| optional int32 insert_destination_index = 196; |
| optional int32 join_predicate_index = 197; |
| optional int32 selection_index = 198; |
| } |
| } |
| |
| message SampleWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional int32 relation_id = 208; |
| optional fixed64 block_id = 209; |
| optional bool is_block_sample = 210; |
| optional int32 percentage = 211; |
| optional int32 insert_destination_index = 212; |
| } |
| } |
| |
| message SaveBlocksWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional fixed64 block_id = 224; |
| optional bool force = 225; |
| } |
| } |
| |
| message SelectWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional int32 relation_id = 240; |
| optional int32 insert_destination_index = 241; |
| optional int32 predicate_index = 242; |
| optional fixed64 block_id = 243; |
| optional bool simple_projection = 244; |
| |
| // When 'simple_projection' is true. |
| repeated int32 simple_selection = 245; |
| |
| // Otherwise. |
| optional int32 selection_index = 246; |
| } |
| } |
| |
| message SortMergeRunWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional uint64 operator_index = 256; |
| optional uint64 sort_config_index = 257; |
| repeated Run runs = 258; |
| optional uint64 top_k = 259; |
| optional uint64 merge_level = 260; |
| optional int32 relation_id = 261; |
| optional int32 insert_destination_index = 262; |
| } |
| } |
| |
| message SortRunGenerationWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional uint64 sort_config_index = 272; |
| optional int32 relation_id = 273; |
| optional int32 insert_destination_index = 274; |
| optional fixed64 block_id = 275; |
| } |
| } |
| |
| message TableGeneratorWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional int32 generator_function_index = 288; |
| optional int32 insert_destination_index = 289; |
| } |
| } |
| |
| message TextScanWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional string filename = 301; |
| optional uint64 text_offset = 302; |
| optional uint64 text_segment_size = 303; |
| optional uint32 field_terminator = 304; // For one-byte char. |
| optional bool process_escape_sequences = 305; |
| optional int32 insert_destination_index = 306; |
| } |
| } |
| |
| message UpdateWorkOrder { |
| extend WorkOrder { |
| // All required. |
| optional uint64 operator_index = 320; |
| optional int32 relation_id = 321; |
| optional int32 insert_destination_index = 322; |
| optional int32 predicate_index = 323; |
| optional uint32 update_group_index = 324; |
| optional fixed64 block_id = 325; |
| } |
| } |
| |
| message WindowAggregationWorkOrder { |
| extend WorkOrder { |
| // All required |
| optional uint32 window_aggr_state_index = 336; |
| repeated fixed64 block_ids = 337; |
| optional int32 insert_destination_index = 338; |
| } |
| } |
| |
| message DestroyAggregationStateWorkOrder { |
| extend WorkOrder { |
| optional uint32 aggr_state_index = 339; |
| } |
| } |