Fletchgen
The Fletcher Design Generator
recordbatch.h
1 // Copyright 2018-2019 Delft University of Technology
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include <arrow/api.h>
18 #include <arrow/ipc/api.h>
19 #include <arrow/io/api.h>
20 #include <fletcher/common.h>
21 
22 #include <vector>
23 #include <memory>
24 
25 #include "fletchgen/options.h"
26 
27 namespace fletchgen::srec {
28 
37 void GenerateReadSREC(const std::vector<fletcher::RecordBatchDescription> &meta_in,
38  std::vector<fletcher::RecordBatchDescription> *meta_out,
39  std::ofstream *out,
40  int64_t buffer_align);
41 
48 std::vector<uint64_t> WriteRecordBatchesToSREC(std::ostream *output,
49  const std::vector<std::shared_ptr<arrow::RecordBatch>> &recordbatches);
50 
62 std::vector<std::shared_ptr<arrow::RecordBatch>>
63 ReadRecordBatchesFromSREC(std::istream *input,
64  const std::vector<std::shared_ptr<arrow::Schema>> &schemas,
65  const std::vector<uint64_t> &num_rows,
66  const std::vector<uint64_t> &buf_offsets);
67 
68 } // namespace fletchgen::srec