MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / push_range

Method push_range

src/repr/src/row.rs:2715–2741  ·  view source on GitHub ↗

Pushes a `Datum::Range` derived from the `Range `. # Panics - If lower and upper express finite values and they are datums of different types. - If lower or upper express finite values and are equal to `Datum::Null`. To handle `Datum::Null` properly, use [`RangeBound::new`]. # Notes - This function canonicalizes the range before pushing it to the row. - Prefer this function over `push_r

(&mut self, mut range: Range<Datum<'a>>)

Source from the content-addressed store, hash-verified

2713 /// - Prefer creating [`RangeBound`]s using [`RangeBound::new`], which
2714 /// handles `Datum::Null` in a SQL-friendly way.
2715 pub fn push_range<'a>(&mut self, mut range: Range<Datum<'a>>) -> Result<(), InvalidRangeError> {
2716 range.canonicalize()?;
2717 match range.inner {
2718 None => {
2719 self.row.data.push(Tag::Range.into());
2720 // Untagged bytes only contains the `RANGE_EMPTY` flag value.
2721 self.row.data.push(range::InternalFlags::EMPTY.bits());
2722 Ok(())
2723 }
2724 Some(inner) => self.push_range_with(
2725 RangeLowerBound {
2726 inclusive: inner.lower.inclusive,
2727 bound: inner
2728 .lower
2729 .bound
2730 .map(|value| move |row: &mut RowPacker| Ok(row.push(value))),
2731 },
2732 RangeUpperBound {
2733 inclusive: inner.upper.inclusive,
2734 bound: inner
2735 .upper
2736 .bound
2737 .map(|value| move |row: &mut RowPacker| Ok(row.push(value))),
2738 },
2739 ),
2740 }
2741 }
2742
2743 /// Pushes a `DatumRange` built from the specified arguments.
2744 ///

Callers 10

callMethod · 0.80
evalMethod · 0.80
into_datumMethod · 0.80
decode_text_into_rowMethod · 0.80
arb_rangeFunction · 0.80
try_push_protoMethod · 0.80
encode_rowMethod · 0.80
evalMethod · 0.80
readMethod · 0.80

Calls 4

push_range_withMethod · 0.80
canonicalizeMethod · 0.45
pushMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected