pub fn extract_temporal(&mut self) -> Self {
        // Optimize the expression, as it is only post-optimization that we can be certain
        // that temporal expressions are restricted to filters. We could relax this in the
        // future to be only `inline_expressions` and `remove_undemanded`, but optimization
        // seems to be the best fit at the moment.
        self.optimize();

        // Assert that we no longer have temporal expressions to evaluate. This should only
        // occur if the optimization above results with temporal expressions yielded in the
        // output, which is out of spec for how the type is meant to be used.
        assert!(!self.expressions.iter().any(|e| e.contains_temporal()));

        // Extract temporal predicates from `self.predicates`.
        let mut temporal_predicates = Vec::new();
        self.predicates.retain(|(_position, predicate)| {
            if predicate.contains_temporal() {
                temporal_predicates.push(predicate.clone());
                false
            } else {
                true
            }
        });

        // Determine extended input columns used by temporal filters.
        let mut support = HashSet::new();
        for predicate in temporal_predicates.iter() {
            support.extend(predicate.support());
        }

        // Discover the locations of these columns after `self.projection`.
        let old_projection_len = self.projection.len();
        let mut new_location = HashMap::with_capacity(support.len());
        for original in support.iter() {
            if let Some(position) = self.projection.iter().position(|x| x == original) {
                new_location.insert(*original, position);
            } else {
                new_location.insert(*original, self.projection.len());
                self.projection.push(*original);
            }
        }
        // Permute references in extracted predicates to their new locations.
        for predicate in temporal_predicates.iter_mut() {
            predicate.permute_map(&new_location);
        }

        // Form a new `Self` containing the temporal predicates to return.
        Self::new(self.projection.len())
            .filter(temporal_predicates)
            .project(0..old_projection_len)
    }
/// Extracts temporal predicates into their own `Self`.
///
/// Expressions that are used by the temporal predicates are exposed by `self.projection`,
/// though there could be justification for extracting them as well if they are otherwise
/// unused.
///
/// This separation is valuable when the execution cannot be fused into one operator.
Extracts temporal predicates into their own `Self`.
Expressions that are used by the temporal predicates are exposed by `self.projection`,
though there could be justification for extracting them as well if they are otherwise
unused.

This separation is valuable when the execution cannot be fused into one operator.
Extracts temporal predicates into their own ` Self ` . Expressions that are used by the temporal predicates are exposed by ` self . projection ` though there could be justification for extracting them as well if they are otherwise unused . This separation is valuable when the execution cannot be fused into one operator .
pub fn extract_temporal(&mut self) -> Self {
        // Optimize the expression, as it is only post-optimization that we can be certain
        // that temporal expressions are restricted to filters. We could relax this in the
        // future to be only `inline_expressions` and `remove_undemanded`, but optimization
        // seems to be the best fit at the moment.
        self.optimize();
        // Assert that we no longer have temporal expressions to evaluate. This should only
        // occur if the optimization above results with temporal expressions yielded in the
        // output, which is out of spec for how the type is meant to be used.
        assert!(!self.expressions.iter().any(|e| e.contains_temporal()));
        // Extract temporal predicates from `self.predicates`.
        let mut temporal_predicates = Vec::new();
        self.predicates.retain(|(_position, predicate)| {
            if predicate.contains_temporal() {
                temporal_predicates.push(predicate.clone());
                false
            } else {
                true
            }
        });
        // Determine extended input columns used by temporal filters.
        let mut support = HashSet::new();
        for predicate in temporal_predicates.iter() {
            support.extend(predicate.support());
        }
        // Discover the locations of these columns after `self.projection`.
        let old_projection_len = self.projection.len();
        let mut new_location = HashMap::with_capacity(support.len());
        for original in support.iter() {
            if let Some(position) = self.projection.iter().position(|x| x == original) {
                new_location.insert(*original, position);
            } else {
                new_location.insert(*original, self.projection.len());
                self.projection.push(*original);
            }
        }
        // Permute references in extracted predicates to their new locations.
        for predicate in temporal_predicates.iter_mut() {
            predicate.permute_map(&new_location);
        }
        // Form a new `Self` containing the temporal predicates to return.
        Self::new(self.projection.len())
            .filter(temporal_predicates)
            .project(0..old_projection_len)
    }
pub fn extract_temporal ( & mut self ) -> Self { // Optimize the expression, as it is only post-optimization that we can be certain // that temporal expressions are restricted to filters. We could relax this in the // future to be only `inline_expressions` and `remove_undemanded`, but optimization // seems to be the best fit at the moment. self . optimize ( ) ; // Assert that we no longer have temporal expressions to evaluate. This should only // occur if the optimization above results with temporal expressions yielded in the // output, which is out of spec for how the type is meant to be used. assert ! ( self expressions iter ( ) any ( e e contains_temporal ( ) ) ) ; // Extract temporal predicates from `self.predicates`. let mut temporal_predicates = Vec :: new ( ) ; self . predicates . retain ( | ( _position , predicate ) | { if predicate . contains_temporal ( ) { temporal_predicates . push ( predicate . clone ( ) ) ; false } else { true } } ) ; // Determine extended input columns used by temporal filters. let mut support = HashSet :: new ( ) ; for predicate in temporal_predicates . iter ( ) { support . extend ( predicate . support ( ) ) ; } // Discover the locations of these columns after `self.projection`. let old_projection_len = self . projection . len ( ) ; let mut new_location = HashMap :: with_capacity ( support . len ( ) ) ; for original in support . iter ( ) { if let Some ( position ) = self . projection . iter ( ) . position ( | x | x == original ) { new_location . insert ( * original , position ) ; } else { new_location . insert ( * original , self . projection . len ( ) ) ; self . projection . push ( * original ) ; } } // Permute references in extracted predicates to their new locations. for predicate in temporal_predicates . iter_mut ( ) { predicate . permute_map ( & new_location ) ; } // Form a new `Self` containing the temporal predicates to return. Self :: new ( self . projection . len ( ) ) . filter ( temporal_predicates ) . project ( 0 .. old_projection_len ) }
Extracts temporal predicates into their own `Self`.
Extracts temporal predicates into their own ` Self ` .
&mut self
&mut self