Coverage Report

Created: 2026-04-20 15:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/format/table/hudi_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
#pragma once
18
#include <memory>
19
#include <vector>
20
21
#include "format/orc/vorc_reader.h"
22
#include "format/parquet/vparquet_reader.h"
23
#include "format/table/table_schema_change_helper.h"
24
namespace doris {
25
26
// HudiParquetReader: directly inherits ParquetReader (no composition wrapping).
27
// Schema mapping is done in on_before_init_reader hook via field_id matching.
28
class HudiParquetReader final : public ParquetReader, public TableSchemaChangeHelper {
29
public:
30
    ENABLE_FACTORY_CREATOR(HudiParquetReader);
31
    HudiParquetReader(RuntimeProfile* profile, const TFileScanRangeParams& params,
32
                      const TFileRangeDesc& range, size_t batch_size, const cctz::time_zone* ctz,
33
                      io::IOContext* io_ctx, RuntimeState* state,
34
                      FileMetaCache* meta_cache = nullptr, bool enable_lazy_mat = true)
35
0
            : ParquetReader(profile, params, range, batch_size, ctz, io_ctx, state, meta_cache,
36
0
                            enable_lazy_mat) {}
37
0
    ~HudiParquetReader() final = default;
38
39
protected:
40
    Status on_before_init_reader(ReaderInitContext* ctx) override;
41
};
42
43
// HudiOrcReader: directly inherits OrcReader (no composition wrapping).
44
class HudiOrcReader final : public OrcReader, public TableSchemaChangeHelper {
45
public:
46
    ENABLE_FACTORY_CREATOR(HudiOrcReader);
47
    HudiOrcReader(RuntimeProfile* profile, RuntimeState* state, const TFileScanRangeParams& params,
48
                  const TFileRangeDesc& range, size_t batch_size, const std::string& ctz,
49
                  io::IOContext* io_ctx, FileMetaCache* meta_cache = nullptr,
50
                  bool enable_lazy_mat = true)
51
0
            : OrcReader(profile, state, params, range, batch_size, ctz, io_ctx, meta_cache,
52
0
                        enable_lazy_mat) {}
53
0
    ~HudiOrcReader() final = default;
54
55
protected:
56
    Status on_before_init_reader(ReaderInitContext* ctx) override;
57
};
58
59
} // namespace doris