Coverage Report

Created: 2026-03-11 08:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/be/src/exprs/vstruct_literal.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "exprs/vstruct_literal.h"
19
20
#include <memory>
21
#include <vector>
22
23
#include "core/column/column.h"
24
#include "core/data_type/data_type.h"
25
#include "core/field.h"
26
#include "exprs/vexpr.h"
27
28
namespace doris {
29
class RowDescriptor;
30
class RuntimeState;
31
class VExprContext;
32
} // namespace doris
33
34
namespace doris {
35
36
Status VStructLiteral::prepare(RuntimeState* state, const RowDescriptor& row_desc,
37
0
                               VExprContext* context) {
38
0
    RETURN_IF_ERROR_OR_PREPARED(VExpr::prepare(state, row_desc, context));
39
0
    Field struct_field = Field::create_field<TYPE_STRUCT>(Tuple());
40
0
    for (const auto& child : _children) {
41
0
        Field item;
42
0
        auto child_literal = std::dynamic_pointer_cast<const VLiteral>(child);
43
0
        child_literal->get_column_ptr()->get(0, item);
44
0
        struct_field.get<TYPE_STRUCT>().push_back(item);
45
0
    }
46
0
    _column_ptr = _data_type->create_column_const(1, struct_field);
47
0
    return Status::OK();
48
0
}
49
50
} // namespace doris