/// A helper function that calls [`to_parquet()`], serialising the parquet file
/// into an in-memory buffer and returning the resulting bytes.
A helper function that calls [`to_parquet()`], serialising the parquet file
into an in-memory buffer and returning the resulting bytes.
A helper function that calls [ ` to_parquet () ` ] serialising the parquet file into an in - memory buffer and returning the resulting bytes .
pub async fn to_parquet_bytes<S>(
    batches: S,
    meta: &IoxMetadata,
) -> Result<(Vec<u8>, parquet_format::FileMetaData), CodecError>
where
    S: Stream<Item = Result<RecordBatch, ArrowError>> + Send,
{
    let mut bytes = vec![];
    let partition_id = meta.partition_id;
    debug!(
        ?partition_id,
        ?meta,
        "IOxMetaData provided for serializing the data into the in-memory buffer"
    );
    // Serialize the record batches into the in-memory buffer
    let meta = to_parquet(batches, meta, &mut bytes).await?;
    if meta.row_groups.is_empty() {
        // panic here to avoid later consequence of reading it for statistics
        panic!("partition_id={}. Created Parquet metadata has no column metadata. HINT a common reason of this is writing empty data to parquet file: {:#?}", partition_id, meta);
    }
    trace!(?partition_id, ?meta, "Parquet Metadata");
    bytes.shrink_to_fit();
    Ok((bytes, meta))
}
pub async fn to_parquet_bytes < S > ( batches : S , meta : & IoxMetadata , ) -> Result < ( Vec < u8 > , parquet_format :: FileMetaData ) , CodecError > where S : Stream < Item = Result < RecordBatch , ArrowError > > + Send , { let mut bytes = vec ! [ ] ; let partition_id = meta . partition_id ; debug ! ( partition_id meta " " ) ; // Serialize the record batches into the in-memory buffer let meta = to_parquet ( batches , meta , & mut bytes ) . await ? ; if meta . row_groups . is_empty ( ) { // panic here to avoid later consequence of reading it for statistics panic ! ( " " partition_id meta ) ; } trace ! ( partition_id meta " " ) ; bytes . shrink_to_fit ( ) ; Ok ( ( bytes , meta ) ) }
A helper function that calls [`to_parquet()`], serialising the parquet file
into an in-memory buffer and returning the resulting bytes.
A helper function that calls [ ` to_parquet () ` ] serialising the parquet file into an in - memory buffer and returning the resulting bytes .
batches
S
meta
&IoxMetadata