blob: 15fde922b89f17926d708844907c104a9ae1d76c [file] [log] [blame]
// 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";
// Next tag: 27.
enum WorkOrderType {
AGGREGATION = 1;
BUILD_AGGREGATION_EXISTENCE_MAP = 23;
BUILD_HASH = 2;
BUILD_LIP_FILTER = 3;
CREATE_INDEX = 4; // Placeholder.
CREATE_TABLE = 5; // Placeholder.
DELETE = 6;
DESTROY_AGGREGATION_STATE = 22;
DESTROY_HASH = 7;
DROP_TABLE = 8;
FINALIZE_AGGREGATION = 9;
HASH_JOIN = 10;
INITIALIZE_AGGREGATION = 25;
INSERT = 11;
NESTED_LOOP_JOIN = 12;
SAMPLE = 13;
SAVE_BLOCKS = 14;
SELECT = 15;
SORT_MERGE_RUN = 16;
SORT_RUN_GENERATION = 17;
TABLE_EXPORT_TO_STRING = 26;
TABLE_GENERATOR = 18;
TEXT_SCAN = 19;
UNION_ALL = 24;
UPDATE = 20;
WINDOW_AGGREGATION = 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 * 16).
extensions 16 to max;
}
// Next tag: 21.
message AggregationWorkOrder {
extend WorkOrder {
// All required.
optional uint32 aggr_state_index = 16;
optional uint64 partition_id = 20;
optional fixed64 block_id = 17;
optional int32 lip_deployment_index = 18;
repeated uint32 lip_filter_indexes = 19;
}
}
message BuildAggregationExistenceMapWorkOrder {
extend WorkOrder {
optional int32 relation_id = 368;
optional fixed64 build_block_id = 369;
optional int32 build_attribute = 370;
optional uint32 aggr_state_index = 371;
optional uint64 partition_id = 372;
}
}
// Next tag: 41.
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 uint64 partition_id = 38;
optional fixed64 block_id = 36;
optional int32 lip_deployment_index = 37;
repeated uint32 lip_filter_indexes = 39;
optional uint32 build_predicate_index = 40;
}
}
// Next tag: 54.
message BuildLIPFilterWorkOrder {
extend WorkOrder {
// All required.
optional int32 relation_id = 48;
optional uint64 partition_id = 53;
optional fixed64 build_block_id = 49;
optional int32 build_side_predicate_index = 50;
optional int32 lip_deployment_index = 51;
repeated uint32 lip_filter_indexes = 52;
}
}
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;
optional uint64 partition_id = 100;
}
}
message DestroyAggregationStateWorkOrder {
extend WorkOrder {
optional uint32 aggr_state_index = 352;
optional uint64 partition_id = 353;
}
}
message DestroyHashWorkOrder {
extend WorkOrder {
// All required.
optional uint32 join_hash_table_index = 112;
optional uint64 partition_id = 113;
}
}
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;
}
}
// Next tag: 148.
message FinalizeAggregationWorkOrder {
extend WorkOrder {
// All required.
optional uint32 aggr_state_index = 144;
optional uint64 partition_id = 146;
optional uint64 state_partition_id = 147;
optional int32 insert_destination_index = 145;
}
}
// Next tag: 174.
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 uint64 partition_id = 172;
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;
optional int32 lip_deployment_index = 171;
repeated uint32 lip_filter_indexes = 173;
}
}
message InitializeAggregationWorkOrder {
extend WorkOrder {
// All required.
optional uint32 aggr_state_index = 400;
optional uint64 partition_id = 401;
optional uint64 state_partition_id = 402;
}
}
message InsertWorkOrder {
extend WorkOrder {
// All required.
optional int32 insert_destination_index = 176;
repeated uint32 tuple_indexes = 177;
}
}
// Next tag: 201.
message NestedLoopsJoinWorkOrder {
extend WorkOrder {
// All required.
optional uint64 nested_loops_join_index = 200;
optional int32 left_relation_id = 192;
optional int32 right_relation_id = 193;
optional uint64 partition_id = 199;
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;
optional uint64 partition_id = 226;
}
}
// Next tag: 250.
message SelectWorkOrder {
extend WorkOrder {
// All required.
optional int32 relation_id = 240;
optional int32 insert_destination_index = 241;
optional int32 predicate_index = 242;
optional uint64 partition_id = 249;
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;
optional int32 lip_deployment_index = 247;
repeated uint32 lip_filter_indexes = 248;
}
}
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 = 304;
optional uint64 text_offset = 305;
optional uint64 text_segment_size = 306;
optional uint32 field_terminator = 307; // For one-byte char.
optional bool process_escape_sequences = 308;
optional int32 insert_destination_index = 309;
}
}
message UnionAllWorkOrder {
extend WorkOrder {
optional int32 relation_id = 384;
optional int32 insert_destination_index = 385;
optional fixed64 block_id = 386;
repeated int32 select_attribute_id = 387;
}
}
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;
optional uint64 partition_id = 326;
}
}
message WindowAggregationWorkOrder {
extend WorkOrder {
// All required
optional uint32 window_aggr_state_index = 336;
repeated fixed64 block_ids = 337;
optional int32 insert_destination_index = 338;
}
}