Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 08:28:53

0001 // Licensed to the Apache Software Foundation (ASF) under one
0002 // or more contributor license agreements.  See the NOTICE file
0003 // distributed with this work for additional information
0004 // regarding copyright ownership.  The ASF licenses this file
0005 // to you under the Apache License, Version 2.0 (the
0006 // "License"); you may not use this file except in compliance
0007 // with the License.  You may obtain a copy of the License at
0008 //
0009 //   http://www.apache.org/licenses/LICENSE-2.0
0010 //
0011 // Unless required by applicable law or agreed to in writing,
0012 // software distributed under the License is distributed on an
0013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0014 // KIND, either express or implied.  See the License for the
0015 // specific language governing permissions and limitations
0016 // under the License.
0017 
0018 #pragma once
0019 
0020 #include "arrow/io/interfaces.h"
0021 #include "parquet/properties.h"
0022 #include "parquet/type_fwd.h"
0023 
0024 namespace parquet {
0025 
0026 class InternalFileDecryptor;
0027 class BloomFilter;
0028 
0029 class PARQUET_EXPORT RowGroupBloomFilterReader {
0030  public:
0031   virtual ~RowGroupBloomFilterReader() = default;
0032 
0033   /// \brief Read bloom filter of a column chunk.
0034   ///
0035   /// \param[in] i column ordinal of the column chunk.
0036   /// \returns bloom filter of the column or nullptr if it does not exist.
0037   /// \throws ParquetException if the index is out of bound, or read bloom
0038   /// filter failed.
0039   virtual std::unique_ptr<BloomFilter> GetColumnBloomFilter(int i) = 0;
0040 };
0041 
0042 /// \brief Interface for reading the bloom filter for a Parquet file.
0043 class PARQUET_EXPORT BloomFilterReader {
0044  public:
0045   virtual ~BloomFilterReader() = default;
0046 
0047   /// \brief Create a BloomFilterReader instance.
0048   /// \returns a BloomFilterReader instance.
0049   /// WARNING: The returned BloomFilterReader references to all the input parameters, so
0050   /// it must not outlive all of the input parameters. Usually these input parameters
0051   /// come from the same ParquetFileReader object, so it must not outlive the reader
0052   /// that creates this BloomFilterReader.
0053   static std::unique_ptr<BloomFilterReader> Make(
0054       std::shared_ptr<::arrow::io::RandomAccessFile> input,
0055       std::shared_ptr<FileMetaData> file_metadata, const ReaderProperties& properties,
0056       std::shared_ptr<InternalFileDecryptor> file_decryptor = NULLPTR);
0057 
0058   /// \brief Get the bloom filter reader of a specific row group.
0059   /// \param[in] i row group ordinal to get bloom filter reader.
0060   /// \returns RowGroupBloomFilterReader of the specified row group. A nullptr may or may
0061   ///          not be returned if the bloom filter for the row group is unavailable. It
0062   ///          is the caller's responsibility to check the return value of follow-up calls
0063   ///          to the RowGroupBloomFilterReader.
0064   /// \throws ParquetException if the index is out of bound.
0065   virtual std::shared_ptr<RowGroupBloomFilterReader> RowGroup(int i) = 0;
0066 };
0067 
0068 }  // namespace parquet