MCPcopy Create free account
hub / github.com/apache/paimon-rust / test_builder_comparison_ops

Function test_builder_comparison_ops

crates/paimon/src/spec/predicate.rs:971–995  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

969
970 #[test]
971 fn test_builder_comparison_ops() {
972 let pb = PredicateBuilder::new(&test_fields());
973
974 let ops_and_builders: Vec<(PredicateOperator, Result<Predicate>)> = vec![
975 (PredicateOperator::NotEq, pb.not_equal("id", Datum::Int(1))),
976 (PredicateOperator::Lt, pb.less_than("id", Datum::Int(1))),
977 (
978 PredicateOperator::LtEq,
979 pb.less_or_equal("id", Datum::Int(1)),
980 ),
981 (PredicateOperator::Gt, pb.greater_than("id", Datum::Int(1))),
982 (
983 PredicateOperator::GtEq,
984 pb.greater_or_equal("id", Datum::Int(1)),
985 ),
986 ];
987
988 for (expected_op, result) in ops_and_builders {
989 let pred = result.unwrap();
990 match &pred {
991 Predicate::Leaf { op, .. } => assert_eq!(*op, expected_op),
992 other => panic!("expected Leaf, got {other:?}"),
993 }
994 }
995 }
996
997 #[test]
998 fn test_builder_null_ops() {

Callers

nothing calls this directly

Calls 1

test_fieldsFunction · 0.70

Tested by

no test coverage detected