|
sparrow-ipc 0.2.0
|
Examples demonstrating deserialization of Arrow IPC streams using sparrow-ipc. More...
#include <iostream>#include <span>#include <vector>#include <sparrow/record_batch.hpp>#include <sparrow_ipc/deserialize.hpp>#include <sparrow_ipc/deserializer.hpp>#include <sparrow_ipc/memory_output_stream.hpp>#include <sparrow_ipc/serializer.hpp>Go to the source code of this file.
Functions | |
| std::vector< sp::record_batch > | create_sample_batches (size_t count) |
| Helper function to create sample record batches for demonstration. | |
| std::vector< uint8_t > | serialize_batches (const std::vector< sp::record_batch > &batches) |
| Helper function to serialize batches to a byte buffer. | |
| std::vector< sp::record_batch > | deserialize_stream_example (const std::vector< uint8_t > &stream_data) |
| Example: Deserialize a stream using the function API. | |
| void | deserializer_basic_example (const std::vector< uint8_t > &stream_data) |
| Example: Basic usage of the deserializer class. | |
| void | deserializer_incremental_example (const std::vector< std::vector< uint8_t > > &stream_chunks) |
| Example: Incremental deserialization with the deserializer class. | |
| void | deserializer_chaining_example (const std::vector< uint8_t > &chunk1, const std::vector< uint8_t > &chunk2, const std::vector< uint8_t > &chunk3) |
| Example: Chaining multiple deserializations. | |
| int | main () |
Examples demonstrating deserialization of Arrow IPC streams using sparrow-ipc.
This file shows different ways to deserialize Arrow IPC streams:
Definition in file deserializer_example.cpp.
| std::vector< sp::record_batch > create_sample_batches | ( | size_t | count | ) |
Helper function to create sample record batches for demonstration.
Definition at line 27 of file deserializer_example.cpp.
| std::vector< sp::record_batch > deserialize_stream_example | ( | const std::vector< uint8_t > & | stream_data | ) |
Example: Deserialize a stream using the function API.
This is the simplest way to deserialize an Arrow IPC stream. Use this when you have the complete stream data available.
Definition at line 66 of file deserializer_example.cpp.
| void deserializer_basic_example | ( | const std::vector< uint8_t > & | stream_data | ) |
Example: Basic usage of the deserializer class.
The deserializer class allows you to accumulate record batches into an existing container as you deserialize data.
Definition at line 82 of file deserializer_example.cpp.
| void deserializer_chaining_example | ( | const std::vector< uint8_t > & | chunk1, |
| const std::vector< uint8_t > & | chunk2, | ||
| const std::vector< uint8_t > & | chunk3 ) |
Example: Chaining multiple deserializations.
The streaming operator can be chained for fluent API usage.
Definition at line 136 of file deserializer_example.cpp.
| void deserializer_incremental_example | ( | const std::vector< std::vector< uint8_t > > & | stream_chunks | ) |
Example: Incremental deserialization with the deserializer class.
This example shows how to deserialize data incrementally as it arrives, which is useful for streaming scenarios where data comes in chunks.
Definition at line 109 of file deserializer_example.cpp.
| int main | ( | ) |
| std::vector< uint8_t > serialize_batches | ( | const std::vector< sp::record_batch > & | batches | ) |
Helper function to serialize batches to a byte buffer.
Definition at line 50 of file deserializer_example.cpp.