| 1254 | |
| 1255 | impl<'c> From<&ExplainContext<'c>> for DerivedBuilder<'c> { |
| 1256 | fn from(context: &ExplainContext<'c>) -> DerivedBuilder<'c> { |
| 1257 | let mut builder = DerivedBuilder::new(context.features); |
| 1258 | if context.config.subtree_size { |
| 1259 | builder.require(super::SubtreeSize); |
| 1260 | } |
| 1261 | if context.config.non_negative { |
| 1262 | builder.require(super::NonNegative); |
| 1263 | } |
| 1264 | if context.config.types { |
| 1265 | builder.require(super::ReprRelationType); |
| 1266 | } |
| 1267 | if context.config.arity { |
| 1268 | builder.require(super::Arity); |
| 1269 | } |
| 1270 | if context.config.keys { |
| 1271 | builder.require(super::UniqueKeys); |
| 1272 | } |
| 1273 | if context.config.cardinality { |
| 1274 | builder.require(super::Cardinality::with_stats( |
| 1275 | context.cardinality_stats.clone(), |
| 1276 | )); |
| 1277 | } |
| 1278 | if context.config.column_names || context.config.humanized_exprs { |
| 1279 | builder.require(super::ColumnNames); |
| 1280 | } |
| 1281 | if context.config.equivalences { |
| 1282 | builder.require(Equivalences); |
| 1283 | } |
| 1284 | builder |
| 1285 | } |
| 1286 | } |
| 1287 | |
| 1288 | /// Produce an [`AnnotatedPlan`] wrapping the given [`MirRelationExpr`] along |