be/src/exprs/function/function_to_file.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 | | |
20 | | #include "exprs/function/function.h" |
21 | | |
22 | | namespace doris { |
23 | | namespace io { |
24 | | class FileSystem; |
25 | | } |
26 | | |
27 | | class FunctionToFile : public IFunction { |
28 | | public: |
29 | | static constexpr auto name = "to_file"; |
30 | 5 | static FunctionPtr create() { return std::make_shared<FunctionToFile>(); } |
31 | 1 | String get_name() const override { return name; } |
32 | 3 | size_t get_number_of_arguments() const override { return 2; } |
33 | 53 | ColumnNumbers get_arguments_that_are_always_constant() const override { return {0}; } |
34 | 57 | bool use_default_implementation_for_constants() const override { return false; } |
35 | 56 | bool use_default_implementation_for_nulls() const override { return false; } |
36 | 1 | bool is_blockable() const override { return true; } |
37 | | |
38 | | DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments) const override; |
39 | | Status open(FunctionContext* context, FunctionContext::FunctionStateScope scope) override; |
40 | | Status close(FunctionContext* context, FunctionContext::FunctionStateScope scope) override; |
41 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
42 | | uint32_t result, size_t input_rows_count) const override; |
43 | | |
44 | | protected: |
45 | | virtual Status create_filesystem(const TS3Resource& resource, const std::string& uri, |
46 | | std::shared_ptr<io::FileSystem>* filesystem) const; |
47 | | }; |
48 | | |
49 | | } // namespace doris |