Skip to content

Commit 840a6c3

Browse files
committed
Use stream file serializer and deserializer
1 parent bd5e274 commit 840a6c3

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

integration_tests/arrow_file_to_stream.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "sparrow/json_reader/json_parser.hpp"
1111

1212
#include <sparrow_ipc/memory_output_stream.hpp>
13-
#include <sparrow_ipc/serializer.hpp>
13+
#include <sparrow_ipc/stream_file_serializer.hpp>
1414

1515
/**
1616
* @brief Reads a JSON file containing record batches and outputs the serialized Arrow IPC stream to stdout.
@@ -98,9 +98,9 @@ int main(int argc, char* argv[])
9898
// Serialize record batches to Arrow IPC stream format
9999
std::vector<uint8_t> stream_data;
100100
sparrow_ipc::memory_output_stream stream(stream_data);
101-
sparrow_ipc::serializer serializer(stream);
102-
103-
serializer << record_batches << sparrow_ipc::end_stream;
101+
sparrow_ipc::stream_file_serializer serializer(stream);
102+
serializer << record_batches;
103+
serializer.end();
104104

105105
// Write the binary stream to stdout
106106
std::cout.write(reinterpret_cast<const char*>(stream_data.data()), stream_data.size());

integration_tests/arrow_json_to_file.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <nlohmann/json.hpp>
88
#include <sparrow_ipc/memory_output_stream.hpp>
9-
#include <sparrow_ipc/serializer.hpp>
9+
#include <sparrow_ipc/stream_file_serializer.hpp>
1010

1111
#include <sparrow/json_reader/json_parser.hpp>
1212
#include <sparrow/record_batch.hpp>
@@ -97,9 +97,9 @@ int main(int argc, char* argv[])
9797
// Serialize record batches to Arrow IPC stream format
9898
std::vector<uint8_t> stream_data;
9999
sparrow_ipc::memory_output_stream stream(stream_data);
100-
sparrow_ipc::serializer serializer(stream);
101-
102-
serializer << record_batches << sparrow_ipc::end_stream;
100+
sparrow_ipc::stream_file_serializer serializer(stream);
101+
serializer << record_batches;
102+
serializer.end();
103103

104104
// Write the binary stream to the output file
105105
std::ofstream output_file(output_path, std::ios::out | std::ios::binary);

integration_tests/arrow_stream_to_file.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include <sparrow_ipc/deserialize.hpp>
99
#include <sparrow_ipc/memory_output_stream.hpp>
10-
#include <sparrow_ipc/serializer.hpp>
10+
#include <sparrow_ipc/stream_file_serializer.hpp>
1111

1212
/**
1313
* @brief Reads an Arrow IPC stream from a file and writes it to another file.
@@ -79,9 +79,9 @@ int main(int argc, char* argv[])
7979
// Re-serialize the record batches to ensure a valid output stream
8080
std::vector<uint8_t> output_stream_data;
8181
sparrow_ipc::memory_output_stream stream(output_stream_data);
82-
sparrow_ipc::serializer serializer(stream);
83-
84-
serializer << record_batches << sparrow_ipc::end_stream;
82+
sparrow_ipc::stream_file_serializer serializer(stream);
83+
serializer << record_batches;
84+
serializer.end();
8585

8686
// Write the stream to the output file
8787
std::ofstream output_file(output_path, std::ios::out | std::ios::binary);

0 commit comments

Comments
 (0)