MCPcopy Create free account
hub / github.com/apache/arrow-rs / append_null

Method append_null

arrow-avro/src/reader/record.rs:629–716  ·  view source on GitHub ↗

Append a null record

(&mut self)

Source from the content-addressed store, hash-verified

627
628 /// Append a null record
629 fn append_null(&mut self) -> Result<(), AvroError> {
630 match self {
631 Self::Null(count) => *count += 1,
632 Self::Boolean(b) => b.append(false),
633 Self::Int32(v) | Self::Date32(v) | Self::TimeMillis(v) => v.push(0),
634 Self::Int64(v)
635 | Self::Int32ToInt64(v)
636 | Self::TimeMicros(v)
637 | Self::TimestampMillis(_, v)
638 | Self::TimestampMicros(_, v)
639 | Self::TimestampNanos(_, v) => v.push(0),
640 #[cfg(feature = "avro_custom_types")]
641 Self::DurationSecond(v)
642 | Self::DurationMillisecond(v)
643 | Self::DurationMicrosecond(v)
644 | Self::DurationNanosecond(v) => v.push(0),
645 #[cfg(feature = "avro_custom_types")]
646 Self::Int8(v) => v.push(0),
647 #[cfg(feature = "avro_custom_types")]
648 Self::Int16(v) => v.push(0),
649 #[cfg(feature = "avro_custom_types")]
650 Self::UInt8(v) => v.push(0),
651 #[cfg(feature = "avro_custom_types")]
652 Self::UInt16(v) => v.push(0),
653 #[cfg(feature = "avro_custom_types")]
654 Self::UInt32(v) => v.push(0),
655 #[cfg(feature = "avro_custom_types")]
656 Self::UInt64(v) => v.push(0),
657 #[cfg(feature = "avro_custom_types")]
658 Self::Float16(v) => v.push(0),
659 #[cfg(feature = "avro_custom_types")]
660 Self::Date64(v) | Self::TimeNanos(v) | Self::TimestampSecs(_, v) => v.push(0),
661 #[cfg(feature = "avro_custom_types")]
662 Self::IntervalDayTime(v) => v.push(IntervalDayTime::new(0, 0)),
663 #[cfg(feature = "avro_custom_types")]
664 Self::IntervalMonthDayNano(v) => v.push(IntervalMonthDayNano::new(0, 0, 0)),
665 #[cfg(feature = "avro_custom_types")]
666 Self::Time32Secs(v) | Self::IntervalYearMonth(v) => v.push(0),
667 Self::Float32(v) | Self::Int32ToFloat32(v) | Self::Int64ToFloat32(v) => v.push(0.),
668 Self::Float64(v)
669 | Self::Int32ToFloat64(v)
670 | Self::Int64ToFloat64(v)
671 | Self::Float32ToFloat64(v) => v.push(0.),
672 Self::Binary(offsets, _)
673 | Self::String(offsets, _)
674 | Self::StringView(offsets, _)
675 | Self::BytesToString(offsets, _)
676 | Self::StringToBytes(offsets, _) => {
677 offsets.push_length(0);
678 }
679 Self::Uuid(v) => {
680 v.extend([0; 16]);
681 }
682 Self::Array(_, offsets, _) => {
683 offsets.push_length(0);
684 }
685 Self::Record(_, e, _, _) => {
686 for encoding in e.iter_mut() {

Callers 5

test_list_columnsFunction · 0.45
test_nested_recordsFunction · 0.45
append_defaultMethod · 0.45
decodeMethod · 0.45

Calls 6

push_lengthMethod · 0.80
on_decoderMethod · 0.80
appendMethod · 0.45
pushMethod · 0.45
extendMethod · 0.45
append_valueMethod · 0.45

Tested by 3

test_list_columnsFunction · 0.36
test_nested_recordsFunction · 0.36