Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Nov 30, 2024
1 parent 893813f commit bbdaf7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arrow-avro/src/reader/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl RecordDecoder {
Ok(cursor.position())
}

/// Flush the decoded records into a [`RecordBatch`]
pub fn flush(&mut self) -> Result<RecordBatch, ArrowError> {
let arrays = self
.fields
Expand Down Expand Up @@ -155,6 +156,7 @@ impl Decoder {
})
}

/// Append a null record
fn append_null(&mut self) {
match self {
Self::Null(count) => *count += 1,
Expand All @@ -176,6 +178,7 @@ impl Decoder {
}
}

/// Decode a single record from `buf`
fn decode(&mut self, buf: &mut AvroCursor<'_>) -> Result<(), ArrowError> {
match self {
Self::Null(x) => *x += 1,
Expand Down Expand Up @@ -216,6 +219,7 @@ impl Decoder {
Ok(())
}

/// Flush decoded records to an [`ArrayRef`]
fn flush(&mut self, nulls: Option<NullBuffer>) -> Result<ArrayRef, ArrowError> {
Ok(match self {
Self::Nullable(_, n, e) => e.flush(n.finish())?,
Expand Down

0 comments on commit bbdaf7b

Please sign in to comment.