8000 TODO: implement new trait methods for ExcutionPlan and ExecutionPlanP… · apache/datafusion-python@8cd4fd4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8cd4fd4

Browse files
TODO: implement new trait methods for ExcutionPlan and ExecutionPlanProperties
1 parent 6fc2ad1 commit 8cd4fd4

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

src/dataset_exec.rs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ use datafusion::execution::context::TaskContext;
3535
use datafusion::physical_expr::PhysicalSortExpr;
3636
use datafusion::physical_plan::stream::RecordBatchStreamAdapter;
3737
use datafusion::physical_plan::{
38-
DisplayAs, DisplayFormatType, ExecutionPlan, Partitioning, SendableRecordBatchStream,
39-
Statistics,
38+
DisplayAs, DisplayFormatType, ExecutionPlan, ExecutionPlanProperties, Partitioning,
39+
SendableRecordBatchStream, Statistics,
4040
};
4141
use datafusion_expr::utils::conjunction;
4242
use datafusion_expr::Expr;
@@ -156,18 +156,6 @@ impl ExecutionPlan for DatasetExec {
156156
self.schema.clone()
157157
}
158158

159-
/// Get the output partitioning of this plan
160-
fn output_partitioning(&self) -> Partitioning {
161-
Python::with_gil(|py| {
162-
let fragments = self.fragments.as_ref(py);
163-
Partitioning::UnknownPartitioning(fragments.len())
164-
})
165-
}
166-
167-
fn output_ordering(&self) -> Option<&[PhysicalSortExpr]> {
168-
None
169-
}
170-
171159
fn children(&self) -> Vec<Arc<dyn ExecutionPlan>> {
172160
// this is a leaf node and has no children
173161
vec![]
@@ -240,6 +228,32 @@ impl ExecutionPlan for DatasetExec {
240228
fn statistics(&self) -> DFResult<Statistics> {
241229
Ok(self.projected_statistics.clone())
242230
}
231+
232+
fn properties(&self) -> &datafusion::physical_plan::PlanProperties {
233+
todo!()
234+
}
235+
}
236+
237+
impl ExecutionPlanProperties for DatasetExec {
238+
/// Get the output partitioning of this plan
239+
fn output_partitioning(&self) -> &Partitioning {
240+
&Python::with_gil(|py| {
241+
let fragments = self.fragments.as_ref(py);
242+
Partitioning::UnknownPartitioning(fragments.len())
243+
})
244+
}
245+
246+
fn output_ordering(&self) -> Option<&[PhysicalSortExpr]> {
247+
None
248+
}
249+
250+
fn execution_mode(&self) -> datafusion::physical_plan::ExecutionMode {
251+
todo!()
252+
}
253+
254+
fn equivalence_properties(&self) -> &datafusion::physical_expr::EquivalenceProperties {
255+
todo!()
256+
}
243257
}
244258

245259
impl DisplayAs for DatasetExec {

src/physical_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use datafusion::physical_plan::{displayable, ExecutionPlan};
18+
use datafusion::physical_plan::{displayable, ExecutionPlan, ExecutionPlanProperties};
1919
use std::sync::Arc;
2020

2121
use pyo3::prelude::*;

0 commit comments

Comments
 (0)
0