Apache DataFusion SQL Query Engine
Add getters to `ExecutionPlan` Properties (#13409)
Shehab Amin57235c2fedc2
diff --git a/datafusion/core/src/datasource/physical_plan/json.rs b/datafusion/core/src/datasource/physical_plan/json.rsindex 6cb9d9df70..7b0a605aed 100644--- a/datafusion/core/src/datasource/physical_plan/json.rs+++ b/datafusion/core/src/datasource/physical_plan/json.rs@@ -86,6 +86,11 @@ impl NdJsonExec {&self.base_config}+ /// Ref to file compression type+ pub fn file_compression_type(&self) -> &FileCompressionType {+ &self.file_compression_type+ }+fn output_partitioning_helper(file_scan_config: &FileScanConfig) -> Partitioning {Partitioning::UnknownPartitioning(file_scan_config.file_groups.len())}diff --git a/datafusion/physical-plan/src/joins/sort_merge_join.rs b/datafusion/physical-plan/src/joins/sort_merge_join.rsindex a01cd348f0..5b1a296658 100644--- a/datafusion/physical-plan/src/joins/sort_merge_join.rs+++ b/datafusion/physical-plan/src/joins/sort_merge_join.rs@@ -204,18 +204,36 @@ impl SortMergeJoinExec {&self.on}+ /// Ref to right execution planpub fn right(&self) -> &Arc<dyn ExecutionPlan> {&self.right}+ /// Join typepub fn join_type(&self) -> JoinType {self.join_type}+ /// Ref to left execution planpub fn left(&self) -> &Arc<dyn ExecutionPlan> {&self.left}+ /// Ref to join filter+ pub fn filter(&self) -> &Option<JoinFilter> {+ &self.filter+ }++ /// Ref to sort options+ pub fn sort_options(&self) -> &[SortOptions] {+ &self.sort_options+ }++ /// Null equals null+ pub fn null_equals_null(&self) -> bool {+ self.null_equals_null+ }+/// This function creates the cache object that stores the plan properties such as schema, equivalence properties, ordering, partitioning, etc.fn compute_properties(left: &Arc<dyn ExecutionPlan>,diff --git a/datafusion/physical-plan/src/memory.rs b/datafusion/physical-plan/src/memory.rsindex c9ada345af..272dcdc95b 100644--- a/datafusion/physical-plan/src/memory.rs+++ b/datafusion/physical-plan/src/memory.rs@@ -178,14 +178,26 @@ impl MemoryExec {self}+ /// Ref to partitionspub fn partitions(&self) -> &[Vec<RecordBatch>] {&self.partitions}+ /// Ref to projectionpub fn projection(&self) -> &Option<Vec<usize>> {&self.projection}+ /// Show sizes+ pub fn show_sizes(&self) -> bool {+ self.show_sizes+ }++ /// Ref to sort information+ pub fn sort_information(&self) -> &[LexOrdering] {+ &self.sort_information+ }+/// A memory table can be ordered by multiple expressions simultaneously./// [`EquivalenceProperties`] keeps track of expressions that describe the/// global ordering of the schema. These columns are not necessarily same; e.g.@@ -261,6 +273,7 @@ impl MemoryExec {Ok(self)}+ /// Arc clone of ref to original schemapub fn original_schema(&self) -> SchemaRef {Arc::clone(&self.schema)}diff --git a/datafusion/physical-plan/src/recursive_query.rs b/datafusion/physical-plan/src/recursive_query.rsindex cbf22a4b39..0137e5d52f 100644--- a/datafusion/physical-plan/src/recursive_query.rs+++ b/datafusion/physical-plan/src/recursive_query.rs@@ -95,6 +95,26 @@ impl RecursiveQueryExec {})}+ /// Ref to name+ pub fn name(&self) -> &str {+ &self.name+ }++ /// Ref to static term+ pub fn static_term(&self) -> &Arc<dyn ExecutionPlan> {+ &self.static_term+ }++ /// Ref to recursive term+ pub fn recursive_term(&self) -> &Arc<dyn ExecutionPlan> {+ &self.recursive_term+ }++ /// is distinct+ pub fn is_distinct(&self) -> bool {+ self.is_distinct+ }+/// This function creates the cache object that stores the plan properties such as schema, equivalence properties, ordering, partitioning, etc.fn compute_properties(schema: SchemaRef) -> PlanProperties {let eq_properties = EquivalenceProperties::new(schema);diff --git a/datafusion/physical-plan/src/sorts/partial_sort.rs b/datafusion/physical-plan/src/sorts/partial_sort.rsindex e69989c1be..dde19f46cd 100644--- a/datafusion/physical-plan/src/sorts/partial_sort.rs+++ b/datafusion/physical-plan/src/sorts/partial_sort.rs@@ -167,6 +167,11 @@ impl PartialSortExec {self.fetch}+ /// Common prefix length+ pub fn common_prefix_length(&self) -> usize {+ self.common_prefix_length+ }+fn output_partitioning_helper(input: &Arc<dyn ExecutionPlan>,preserve_partitioning: bool,diff --git a/datafusion/physical-plan/src/work_table.rs b/datafusion/physical-plan/src/work_table.rsindex 61d444171c..add3863192 100644--- a/datafusion/physical-plan/src/work_table.rs+++ b/datafusion/physical-plan/src/work_table.rs@@ -120,6 +120,16 @@ impl WorkTableExec {}}+ /// Ref to name+ pub fn name(&self) -> &str {+ &self.name+ }++ /// Arc clone of ref to schema+ pub fn schema(&self) -> SchemaRef {+ Arc::clone(&self.schema)+ }+pub(super) fn with_work_table(&self, work_table: Arc<WorkTable>) -> Self {Self {name: self.name.clone(),