File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
physical-expr/src/expressions Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -550,7 +550,8 @@ impl FilePruner {
550
550
. with_metadata ( logical_file_schema. metadata ( ) . clone ( ) ) ,
551
551
) ;
552
552
Ok ( Self {
553
- predicate_generation : snapshot_generation ( & predicate) ,
553
+ // Initialize the predicate generation to 0 so that the first time we call `should_prune` we actually check the predicate
554
+ predicate_generation : 0 ,
554
555
predicate,
555
556
pruning_schema,
556
557
file,
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ pub struct DynamicFilterPhysicalExpr {
54
54
#[ derive( Debug ) ]
55
55
struct Inner {
56
56
/// A counter that gets incremented every time the expression is updated so that we can track changes cheaply.
57
- /// This is used for [`PhysicalExpr::generation `] to have a cheap check for changes.
57
+ /// This is used for [`PhysicalExpr::snapshot_generation `] to have a cheap check for changes.
58
58
generation : u64 ,
59
59
expr : Arc < dyn PhysicalExpr > ,
60
60
}
@@ -169,16 +169,17 @@ impl DynamicFilterPhysicalExpr {
169
169
/// This will return the current expression with any children
170
170
/// remapped to match calls to [`PhysicalExpr::with_new_children`].
171
171
pub fn current ( & self ) -> Result < Arc < dyn PhysicalExpr > > {
172
- let inner = self
173
- . inner
174
- . read ( )
175
- . map_err ( |_| {
176
- datafusion_common:: DataFusionError :: Execution (
177
- "Failed to acquire read lock for inner" . to_string ( ) ,
178
- )
179
- } ) ?
180
- . expr
181
- . clone ( ) ;
172
+ let inner = Arc :: clone (
173
+ & self
174
+ . inner
175
+ . read ( )
176
+ . map_err ( |_| {
177
+ datafusion_common:: DataFusionError :: Execution (
178
+ "Failed to acquire read lock for inner" . to_string ( ) ,
179
+ )
180
+ } ) ?
181
+ . expr ,
182
+ ) ;
182
183
let inner =
183
184
Self :: remap_children ( & self . children , self . remapped_children . as_ref ( ) , inner) ?;
184
185
Ok ( inner)
You can’t perform that action at this time.
0 commit comments