be/src/exprs/vlambda_function_expr.h
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 | | #pragma once |
19 | | #include "common/global_types.h" |
20 | | #include "exprs/function/function.h" |
21 | | #include "exprs/vexpr.h" |
22 | | |
23 | | namespace doris { |
24 | | class VLambdaFunctionExpr final : public VExpr { |
25 | | ENABLE_FACTORY_CREATOR(VLambdaFunctionExpr); |
26 | | |
27 | | public: |
28 | 0 | VLambdaFunctionExpr(const TExprNode& node) : VExpr(node) {} |
29 | 0 | ~VLambdaFunctionExpr() override = default; |
30 | | |
31 | 0 | Status prepare(RuntimeState* state, const RowDescriptor& desc, VExprContext* context) override { |
32 | 0 | RETURN_IF_ERROR_OR_PREPARED(VExpr::prepare(state, desc, context)); |
33 | 0 | _prepare_finished = true; |
34 | 0 | return Status::OK(); |
35 | 0 | } |
36 | | |
37 | | Status open(RuntimeState* state, VExprContext* context, |
38 | 0 | FunctionContext::FunctionStateScope scope) override { |
39 | 0 | DCHECK(_prepare_finished); |
40 | 0 | RETURN_IF_ERROR(VExpr::open(state, context, scope)); |
41 | 0 | _open_finished = true; |
42 | 0 | return Status::OK(); |
43 | 0 | } |
44 | | |
45 | | Status execute_column(VExprContext* context, const Block* block, Selector* selector, |
46 | 0 | size_t count, ColumnPtr& result_column) const override { |
47 | 0 | DCHECK(_open_finished || block == nullptr); |
48 | 0 | return get_child(0)->execute_column(context, block, selector, count, result_column); |
49 | 0 | } |
50 | | |
51 | 0 | DataTypePtr execute_type(const Block* block) const override { |
52 | 0 | return get_child(0)->execute_type(block); |
53 | 0 | } |
54 | | |
55 | 0 | const std::string& expr_name() const override { return _expr_name; } |
56 | | |
57 | 0 | uint64_t get_digest(uint64_t seed) const override { return 0; } |
58 | | |
59 | | private: |
60 | | const std::string _expr_name = "vlambda_function_expr"; |
61 | | }; |
62 | | } // namespace doris |