Coverage Report

Created: 2026-03-15 22:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/format/table/lakesoul_jni_reader.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
// DEPRECATED: LakeSoul catalog support has been deprecated and will be removed in a future version.
19
// This file is kept for backward compatibility but should not be used in new code.
20
21
#include "format/table/lakesoul_jni_reader.h"
22
23
#include <map>
24
25
#include "core/types.h"
26
#include "format/jni_reader.h"
27
#include "runtime/descriptors.h"
28
#include "runtime/runtime_state.h"
29
30
namespace doris {
31
#include "common/compile_check_begin.h"
32
class RuntimeProfile;
33
class RuntimeState;
34
35
class Block;
36
} // namespace doris
37
38
namespace doris {
39
LakeSoulJniReader::LakeSoulJniReader(const TLakeSoulFileDesc& lakesoul_params,
40
                                     const std::vector<SlotDescriptor*>& file_slot_descs,
41
                                     RuntimeState* state, RuntimeProfile* profile)
42
0
        : JniReader(file_slot_descs, state, profile), _lakesoul_params(lakesoul_params) {
43
0
    std::vector<std::string> required_fields;
44
0
    for (const auto& desc : _file_slot_descs) {
45
0
        required_fields.emplace_back(desc->col_name());
46
0
    }
47
48
0
    std::map<String, String> params = {
49
0
            {"query_id", print_id(_state->query_id())},
50
0
            {"file_paths", join(_lakesoul_params.file_paths, ";")},
51
0
            {"primary_keys", join(_lakesoul_params.primary_keys, ";")},
52
0
            {"partition_descs", join(_lakesoul_params.partition_descs, ";")},
53
0
            {"required_fields", join(required_fields, ";")},
54
0
            {"options", _lakesoul_params.options},
55
0
            {"table_schema", _lakesoul_params.table_schema},
56
0
    };
57
0
    _jni_connector = std::make_unique<JniConnector>("org/apache/doris/lakesoul/LakeSoulJniScanner",
58
0
                                                    params, required_fields);
59
0
}
60
61
0
Status LakeSoulJniReader::init_reader() {
62
0
    RETURN_IF_ERROR(_jni_connector->init());
63
0
    return _jni_connector->open(_state, _profile);
64
0
}
65
#include "common/compile_check_end.h"
66
} // namespace doris