iceberg-cpp
Loading...
Searching...
No Matches
writer.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
24
25#include <cstdint>
26#include <memory>
27#include <vector>
28
30#include "iceberg/iceberg_data_export.h"
31#include "iceberg/result.h"
32#include "iceberg/type_fwd.h"
33
34namespace iceberg {
35
37class ICEBERG_DATA_EXPORT FileWriter {
38 public:
39 virtual ~FileWriter();
40
43 virtual Status Write(ArrowArray* data) = 0;
44
46 virtual Result<int64_t> Length() const = 0;
47
49 virtual Status Close() = 0;
50
52 struct ICEBERG_DATA_EXPORT WriteResult {
56 std::vector<std::shared_ptr<DataFile>> data_files;
57 };
58
61 virtual Result<WriteResult> Metadata() = 0;
62};
63
64} // namespace iceberg
Base interface for data file writers.
Definition writer.h:37
virtual Status Close()=0
Close the writer and finalize the file.
virtual Result< WriteResult > Metadata()=0
Get file metadata for all files produced by this writer.
virtual Status Write(ArrowArray *data)=0
Write a batch of records.
virtual Result< int64_t > Length() const =0
Get the current number of bytes written.
Definition arrow_c_data.h:57
File metadata for all files produced by this writer.
Definition writer.h:52
std::vector< std::shared_ptr< DataFile > > data_files
Definition writer.h:56