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

Function gen_local_expressions

src/catalog/src/expr_cache.rs:778–788  ·  view source on GitHub ↗

Generate a random [`LocalExpressions`] value. The returned values are mostly hardcoded and only differ in a single randomized number. That's sufficient for the expr cache tests, since the cache mostly treats expressions as opaque objects.

()

Source from the content-addressed store, hash-verified

776 /// That's sufficient for the expr cache tests, since the cache mostly treats expressions as
777 /// opaque objects.
778 fn gen_local_expressions() -> LocalExpressions {
779 let datum = Datum::UInt64(rand::random());
780
781 LocalExpressions {
782 local_mir: OptimizedMirRelationExpr(MirRelationExpr::constant(
783 vec![vec![datum]],
784 ReprRelationType::new(vec![ReprScalarType::UInt64.nullable(false)]),
785 )),
786 optimizer_features: Default::default(),
787 }
788 }
789
790 /// Generate a random [`GlobalExpressions`] value.
791 ///

Callers 2

expression_cacheFunction · 0.85

Calls 1

Tested by

no test coverage detected