YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/common/row.cc
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
#include "yb/common/row.h"
15
16
namespace yb {
17
18
0
const TypeInfo* SimpleConstCell::typeinfo() const {
19
0
  return col_schema_->type_info();
20
0
}
21
22
0
size_t SimpleConstCell::size() const {
23
0
  return col_schema_->type_info()->size;
24
0
}
25
26
0
bool SimpleConstCell::is_nullable() const {
27
0
  return col_schema_->is_nullable();
28
0
}
29
30
RowProjector::RowProjector(const Schema* base_schema, const Schema* projection)
31
  : base_schema_(base_schema), projection_(projection),
32
4
    is_identity_(base_schema->Equals(*projection)) {
33
4
}
34
35
// Initialize the projection mapping with the specified base_schema and projection
36
5
CHECKED_STATUS RowProjector::Init() {
37
5
  return projection_->GetProjectionMapping(*base_schema_, this);
38
5
}
39
40
1
CHECKED_STATUS RowProjector::Reset(const Schema* base_schema, const Schema* projection) {
41
1
  base_schema_ = base_schema;
42
1
  projection_ = projection;
43
1
  base_cols_mapping_.clear();
44
1
  adapter_cols_mapping_.clear();
45
1
  is_identity_ = base_schema->Equals(*projection);
46
1
  return Init();
47
1
}
48
49
1
CHECKED_STATUS RowProjector::ProjectExtraColumn(size_t proj_col_idx) {
50
1
  return STATUS(InvalidArgument,
51
1
    "The column '" + projection_->column(proj_col_idx).name() +
52
1
    "' does not exist in the projection, and it does not have a nullable type");
53
1
}
54
55
}  // namespace yb