Skip to content

Commit 527b3e4

Browse files
committed
preserve FilterExec batch size during ser/de
1 parent b463a9f commit 527b3e4

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

datafusion/physical-plan/src/filter.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ impl FilterExec {
240240
FilterExecBuilder::new(predicate, input).build()
241241
}
242242

243+
/// Get a batch size
244+
pub fn batch_size(&self) -> usize {
245+
self.batch_size
246+
}
247+
243248
/// Set the default selectivity
244249
pub fn with_default_selectivity(
245250
mut self,

datafusion/proto/proto/datafusion.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,7 @@ message FilterExecNode {
10071007
PhysicalExprNode expr = 2;
10081008
uint32 default_filter_selectivity = 3;
10091009
repeated uint32 projection = 9;
1010+
uint32 batch_size = 10;
10101011
}
10111012

10121013
message FileGroup {

datafusion/proto/src/generated/pbjson.rs

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/proto/src/generated/prost.rs

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion/proto/src/physical_plan/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ impl protobuf::PhysicalPlanNode {
590590

591591
let filter = FilterExecBuilder::new(predicate, input)
592592
.apply_projection(projection)?
593+
.with_batch_size(filter.batch_size as usize)
593594
.build()?;
594595
match filter_selectivity {
595596
Ok(filter_selectivity) => Ok(Arc::new(
@@ -2121,6 +2122,7 @@ impl protobuf::PhysicalPlanNode {
21212122
projection: exec.projection().as_ref().map_or_else(Vec::new, |v| {
21222123
v.iter().map(|x| *x as u32).collect::<Vec<u32>>()
21232124
}),
2125+
batch_size: exec.batch_size() as u32,
21242126
},
21252127
))),
21262128
})

0 commit comments

Comments
 (0)