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

Function test_mfp

src/expr/src/interpret.rs:1696–1738  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1694
1695 #[mz_ore::test]
1696 fn test_mfp() {
1697 // Regression test for https://github.com/MaterializeInc/database-issues/issues/5736
1698 use MirScalarExpr::*;
1699
1700 let mfp = MapFilterProject {
1701 expressions: vec![],
1702 predicates: vec![
1703 // Always fails on the known input range
1704 (
1705 1,
1706 CallUnary {
1707 func: UnaryFunc::IsNull(IsNull),
1708 expr: Box::new(CallBinary {
1709 func: MulInt32.into(),
1710 expr1: Box::new(MirScalarExpr::column(0)),
1711 expr2: Box::new(MirScalarExpr::column(0)),
1712 }),
1713 },
1714 ),
1715 // Always returns false on the known input range
1716 (
1717 1,
1718 CallBinary {
1719 func: Eq.into(),
1720 expr1: Box::new(MirScalarExpr::column(0)),
1721 expr2: Box::new(MirScalarExpr::literal_ok(
1722 Datum::Int32(1727694505),
1723 ReprScalarType::Int32,
1724 )),
1725 },
1726 ),
1727 ],
1728 projection: vec![],
1729 input_arity: 1,
1730 };
1731
1732 let relation = ReprRelationType::new(vec![ReprScalarType::Int32.nullable(true)]);
1733 let arena = RowArena::new();
1734 let mut interpreter = ColumnSpecs::new(&relation, &arena);
1735 interpreter.push_column(0, ResultSpec::value(Datum::Int32(-1294725158)));
1736 let spec = interpreter.mfp_filter(&mfp);
1737 assert!(spec.range.may_fail());
1738 }
1739
1740 #[mz_ore::test]
1741 fn test_concat() {

Callers

nothing calls this directly

Calls 2

push_columnMethod · 0.80
mfp_filterMethod · 0.45

Tested by

no test coverage detected