-
Notifications
You must be signed in to change notification settings - Fork 10
/
Catalog.proto
134 lines (110 loc) · 3.51 KB
/
Catalog.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// 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 "storage/StorageBlockLayout.proto";
import "types/Type.proto";
import "types/TypedValue.proto";
message CatalogAttribute {
required string name = 1;
required Type type = 2;
optional string display_name = 3;
}
// TODO(zuyu): Move PartitionScheme to a dedicate proto file.
message PartitionSchemeHeader {
// Next tag: 3.
enum PartitionType {
HASH = 0;
RANDOM = 2;
RANGE = 1;
}
required PartitionType partition_type = 1;
required uint64 num_partitions = 2;
repeated uint32 partition_attribute_ids = 3;
// The convention for extension numbering is that extensions for a particular
// PartitionType should begin from (partition_type + 1) * 16.
extensions 16 to max;
}
message PartitionValues {
repeated TypedValue partition_values = 1;
}
message RangePartitionSchemeHeader {
extend PartitionSchemeHeader {
// All required.
repeated Type partition_attr_types = 32;
repeated PartitionValues partition_range_boundaries = 33;
}
}
message Partition {
repeated fixed64 blocks = 1 [packed=true];
}
message PartitionScheme {
required PartitionSchemeHeader header = 1;
repeated Partition partitions = 2;
}
message NUMAPlacementScheme {
required uint32 num_numa_nodes = 1;
message BlockToNUMANodeEntry {
required fixed64 block_id = 1;
required int32 numa_node = 2;
}
repeated BlockToNUMANodeEntry block_to_numa_node_map = 2;
}
message IndexScheme {
message IndexEntry {
required string index_name = 1;
required IndexSubBlockDescription index_description = 2;
}
repeated IndexEntry index_entries = 1;
}
message CatalogRelationStatistics {
optional bool is_exact = 1;
optional TypedValue num_tuples = 2;
message ColumnStats {
required int32 attr_id = 1;
optional TypedValue num_distinct_values = 2;
optional TypedValue min_value = 3;
optional TypedValue max_value = 4;
}
repeated ColumnStats column_stats = 3;
}
message CatalogRelationSchema {
required int32 relation_id = 1;
required string name = 2;
required bool temporary = 3;
repeated CatalogAttribute attributes = 4;
extensions 16 to max;
}
message CatalogRelation {
extend CatalogRelationSchema {
// Required.
optional StorageBlockLayoutDescription default_layout = 16;
repeated fixed64 blocks = 17 [packed=true];
optional IndexScheme index_scheme = 18;
optional PartitionScheme partition_scheme = 19;
optional NUMAPlacementScheme placement_scheme = 20;
optional CatalogRelationStatistics statistics = 21;
}
}
message CatalogDatabase {
required string name = 1;
repeated CatalogRelationSchema relations = 2;
repeated int32 null_relations = 3;
}
message Catalog {
repeated CatalogDatabase databases = 1;
}