Coverage Report

Created: 2026-04-20 14:38

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/format/arrow/arrow_stream_reader.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 <cstddef>
21
#include <memory>
22
#include <string>
23
#include <unordered_map>
24
#include <unordered_set>
25
#include <vector>
26
27
#include "cctz/time_zone.h"
28
#include "common/status.h"
29
#include "format/arrow/arrow_pip_input_stream.h"
30
#include "format/file_reader/new_plain_text_line_reader.h"
31
#include "format/generic_reader.h"
32
#include "io/file_factory.h"
33
#include "io/fs/file_reader_writer_fwd.h"
34
35
namespace doris {
36
namespace io {
37
class FileSystem;
38
struct IOContext;
39
} // namespace io
40
41
struct ScannerCounter;
42
class Block;
43
44
class ArrowStreamReader : public GenericReader {
45
    ENABLE_FACTORY_CREATOR(ArrowStreamReader);
46
47
public:
48
    ArrowStreamReader(RuntimeState* state, RuntimeProfile* profile, ScannerCounter* counter,
49
                      const TFileScanRangeParams& params, const TFileRangeDesc& range,
50
                      const std::vector<SlotDescriptor*>& file_slot_descs, io::IOContext* io_ctx);
51
52
    ~ArrowStreamReader() override;
53
54
    Status init_reader();
55
56
    Status _do_get_next_block(Block* block, size_t* read_rows, bool* eof) override;
57
58
    Status _get_columns_impl(std::unordered_map<std::string, DataTypePtr>* name_to_type) override;
59
60
protected:
61
0
    Status _do_init_reader(ReaderInitContext* /*ctx*/) override { return init_reader(); }
62
63
private:
64
    RuntimeState* _state;
65
    const TFileRangeDesc& _range;
66
    const std::vector<SlotDescriptor*>& _file_slot_descs;
67
    io::IOContext* _io_ctx;
68
    io::FileReaderSPtr _file_reader;
69
    std::unique_ptr<doris::ArrowPipInputStream> _pip_stream;
70
    cctz::time_zone _ctzz;
71
};
72
} // namespace doris