pub struct RecordDecoder {
delimiter: Reader,
num_columns: usize,
line_number: usize,
offsets: Vec<usize>,
offsets_len: usize,
current_field: usize,
num_rows: usize,
data: Vec<u8>,
data_len: usize,
truncated_rows: bool,
}Expand description
RecordDecoder provides a push-based interface to decoder StringRecords
Fields§
§delimiter: Reader§num_columns: usizeThe expected number of fields per row
line_number: usizeThe current line number
offsets: Vec<usize>Offsets delimiting field start positions
offsets_len: usizeThe current offset into self.offsets
We track this independently of Vec to avoid re-zeroing memory
current_field: usizeThe number of fields read for the current record
num_rows: usizeThe number of rows buffered
data: Vec<u8>Decoded field data
data_len: usizeOffsets into data
We track this independently of Vec to avoid re-zeroing memory
truncated_rows: boolWhether rows with less than expected columns are considered valid
Default value is false When enabled fills in missing columns with null
Implementations§
Source§impl RecordDecoder
impl RecordDecoder
pub fn new(delimiter: Reader, num_columns: usize, truncated_rows: bool) -> Self
Sourcepub fn decode(
&mut self,
input: &[u8],
to_read: usize,
) -> Result<(usize, usize), ArrowError>
pub fn decode( &mut self, input: &[u8], to_read: usize, ) -> Result<(usize, usize), ArrowError>
Decodes records from input returning the number of records and bytes read
Note: this expects to be called with an empty input to signal EOF
Sourcepub fn flush(&mut self) -> Result<StringRecords<'_>, ArrowError>
pub fn flush(&mut self) -> Result<StringRecords<'_>, ArrowError>
Flushes the current contents of the reader