File indexing completed on 2025-08-28 08:26:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #pragma once
0021
0022 #include <memory>
0023 #include <string>
0024
0025 #include "arrow/dataset/file_base.h"
0026 #include "arrow/dataset/type_fwd.h"
0027 #include "arrow/dataset/visibility.h"
0028 #include "arrow/io/type_fwd.h"
0029 #include "arrow/result.h"
0030
0031 namespace arrow {
0032 namespace dataset {
0033
0034
0035
0036
0037
0038 constexpr char kOrcTypeName[] = "orc";
0039
0040
0041 class ARROW_DS_EXPORT OrcFileFormat : public FileFormat {
0042 public:
0043 OrcFileFormat();
0044
0045 std::string type_name() const override { return kOrcTypeName; }
0046
0047 bool Equals(const FileFormat& other) const override {
0048 return type_name() == other.type_name();
0049 }
0050
0051 Result<bool> IsSupported(const FileSource& source) const override;
0052
0053
0054 Result<std::shared_ptr<Schema>> Inspect(const FileSource& source) const override;
0055
0056 Result<RecordBatchGenerator> ScanBatchesAsync(
0057 const std::shared_ptr<ScanOptions>& options,
0058 const std::shared_ptr<FileFragment>& file) const override;
0059
0060 Future<std::optional<int64_t>> CountRows(
0061 const std::shared_ptr<FileFragment>& file, compute::Expression predicate,
0062 const std::shared_ptr<ScanOptions>& options) override;
0063
0064 Result<std::shared_ptr<FileWriter>> MakeWriter(
0065 std::shared_ptr<io::OutputStream> destination, std::shared_ptr<Schema> schema,
0066 std::shared_ptr<FileWriteOptions> options,
0067 fs::FileLocator destination_locator) const override;
0068
0069 std::shared_ptr<FileWriteOptions> DefaultWriteOptions() override;
0070 };
0071
0072
0073
0074 }
0075 }