Commit 912c2e1
authored
chore: split pruning.rs into four files. (#3465)
1. field_or_identity.rs: just cut-and-paste.
2. relation.rs: cut-and-paste but then I added `map(&self) ->
&HashMap...`
3. pruning_predicate.rs: I fixed some nits but also made this somewhat
larger change:
```diff
@@ -95,26 +32,15 @@ impl PruningPredicate {
let (expr, required_stats) = convert_to_pruning_expression(original_expr);
if let Some(lexp) = expr.as_any().downcast_ref::<Literal>() {
// Is the expression constant false, i.e. prune nothing
- if lexp
- .value()
- .as_bool_opt()
- .and_then(|b| b.value())
- .map(|b| !b)
- .unwrap_or(false)
- {
- None
- } else {
- Some(Self {
- expr,
- required_stats,
- })
+ if lexp.value().as_bool_opt().and_then(|b| b.value()) == Some(false) {
+ return None;
}
- } else {
- Some(Self {
- expr,
- required_stats,
- })
}
+
+ Some(Self {
+ expr,
+ required_stats,
+ })
}
```
4. pruning_predicate_rewriter.rs: cut-and-paste but I lifted a type
definition to the top: `type PruningPredicateStats = (ExprRef,
Relation<FieldOrIdentity, Stat>);`
---------
Signed-off-by: Daniel King <[email protected]>1 parent 7b45f4e commit 912c2e1
File tree
7 files changed
+698
-738
lines changed- vortex-expr/src
- pruning
- vortex-layout/src/layouts/zoned
7 files changed
+698
-738
lines changed
0 commit comments