sparrow-ipc 2.0.0
Loading...
Searching...
No Matches
sparrow_ipc::utils Namespace Reference

Functions

constexpr size_t align_to_8 (const size_t n)
 
SPARROW_IPC_API std::optional< std::string_view > get_substr_after_separator (std::string_view str, std::string_view sep)
 
SPARROW_IPC_API std::optional< int32_t > parse_to_int32 (std::string_view str)
 
SPARROW_IPC_API std::optional< int32_t > get_substr_as_int32 (std::string_view str, std::string_view sep)
 
SPARROW_IPC_API std::optional< std::tuple< int32_t, int32_t, std::optional< int32_t > > > parse_decimal_format (std::string_view format_str)
 
SPARROW_IPC_API std::vector< std::string_view > extract_words_after_colon (std::string_view str)
 
template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, sparrow::record_batch>
bool check_record_batches_consistency (const R &record_batches)
 Checks if all record batches in a collection have consistent structure.
 

Function Documentation

◆ align_to_8()

size_t sparrow_ipc::utils::align_to_8 ( const size_t n)
constexpr

◆ check_record_batches_consistency()

template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, sparrow::record_batch>
bool sparrow_ipc::utils::check_record_batches_consistency ( const R & record_batches)

Checks if all record batches in a collection have consistent structure.

This function verifies that all record batches in the provided collection have:

  • The same number of columns
  • Matching data types for corresponding columns (same column index)
Template Parameters
RContainer type that holds sparrow::record_batch objects
Parameters
record_batchesCollection of record batches to check for consistency
Returns
true if all record batches have consistent structure or if the collection is empty, false if any structural inconsistencies are found
Note
An empty collection is considered consistent and returns true
The number of rows per record batch is not required to be the same
Examples
/home/runner/work/sparrow-ipc/sparrow-ipc/include/sparrow_ipc/utils.hpp.

Definition at line 116 of file utils.hpp.

Here is the caller graph for this function:

◆ extract_words_after_colon()

SPARROW_IPC_API std::vector< std::string_view > sparrow_ipc::utils::extract_words_after_colon ( std::string_view str)

◆ get_substr_after_separator()

SPARROW_IPC_API std::optional< std::string_view > sparrow_ipc::utils::get_substr_after_separator ( std::string_view str,
std::string_view sep )

◆ get_substr_as_int32()

SPARROW_IPC_API std::optional< int32_t > sparrow_ipc::utils::get_substr_as_int32 ( std::string_view str,
std::string_view sep )

◆ parse_decimal_format()

SPARROW_IPC_API std::optional< std::tuple< int32_t, int32_t, std::optional< int32_t > > > sparrow_ipc::utils::parse_decimal_format ( std::string_view format_str)

◆ parse_to_int32()

SPARROW_IPC_API std::optional< int32_t > sparrow_ipc::utils::parse_to_int32 ( std::string_view str)