Coverage Report

Created: 2026-03-13 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/udf/python/python_udf_client.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 "udf/python/python_udf_client.h"
19
20
#include "common/status.h"
21
22
namespace doris {
23
24
Status PythonUDFClient::create(const PythonUDFMeta& func_meta, ProcessPtr process,
25
1.27k
                               PythonUDFClientPtr* client) {
26
1.27k
    PythonUDFClientPtr python_udf_client = std::make_shared<PythonUDFClient>();
27
1.27k
    RETURN_IF_ERROR(python_udf_client->init(func_meta, std::move(process)));
28
1.27k
    *client = std::move(python_udf_client);
29
1.27k
    return Status::OK();
30
1.27k
}
31
32
Status PythonUDFClient::evaluate(const arrow::RecordBatch& input,
33
520
                                 std::shared_ptr<arrow::RecordBatch>* output) {
34
520
    RETURN_IF_ERROR(begin_stream(input.schema()));
35
520
    RETURN_IF_ERROR(write_batch(input));
36
520
    RETURN_IF_ERROR(read_batch(output));
37
518
    return Status::OK();
38
520
}
39
40
} // namespace doris