/Users/deen/code/yugabyte-db/src/yb/common/index_column.h
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #ifndef YB_COMMON_INDEX_COLUMN_H |
15 | | #define YB_COMMON_INDEX_COLUMN_H |
16 | | |
17 | | #include "yb/common/column_id.h" |
18 | | #include "yb/common/common.pb.h" |
19 | | |
20 | | namespace yb { |
21 | | |
22 | | // Index column mapping. |
23 | | struct IndexColumn { |
24 | | ColumnId column_id; // Column id in the index table. |
25 | | std::string column_name; // Column name in the index table - colexpr.MangledName(). |
26 | | ColumnId indexed_column_id; // Corresponding column id in indexed table. |
27 | | QLExpressionPB colexpr; // Index expression. |
28 | | |
29 | | explicit IndexColumn(const IndexInfoPB::IndexColumnPB& pb); |
30 | 0 | IndexColumn() {} |
31 | | |
32 | | void ToPB(IndexInfoPB::IndexColumnPB* pb) const; |
33 | | |
34 | | std::string ToString() const; |
35 | | }; |
36 | | |
37 | | } // namespace yb |
38 | | |
39 | | #endif // YB_COMMON_INDEX_COLUMN_H |