This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 57235c2fed Add getters to `ExecutionPlan` Properties (#13409)
57235c2fed is described below
commit 57235c2fedc2b428e1e515c3ba713c6e9bc17672
Author: Shehab Amin <[email protected]>
AuthorDate: Thu Nov 14 13:13:31 2024 -0800
Add getters to `ExecutionPlan` Properties (#13409)
* Expose Execution Plan Properties
* Expose Execution Plan Properties
* Expose Execution Plan Properties
* Expose Execution Plan Properties
* Expose Execution Plan Properties
---
datafusion/core/src/datasource/physical_plan/json.rs | 5 +++++
.../physical-plan/src/joins/sort_merge_join.rs | 18 ++++++++++++++++++
datafusion/physical-plan/src/memory.rs | 13 +++++++++++++
datafusion/physical-plan/src/recursive_query.rs | 20 ++++++++++++++++++++
datafusion/physical-plan/src/sorts/partial_sort.rs | 5 +++++
datafusion/physical-plan/src/work_table.rs | 10 ++++++++++
6 files changed, 71 insertions(+)
diff --git a/datafusion/core/src/datasource/physical_plan/json.rs
b/datafusion/core/src/datasource/physical_plan/json.rs
index 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.rs
index 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 plan
pub fn right(&self) -> &Arc<dyn ExecutionPlan> {
&self.right
}
+ /// Join type
pub fn join_type(&self) -> JoinType {
self.join_type
}
+ /// Ref to left execution plan
pub 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.rs
index 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 partitions
pub fn partitions(&self) -> &[Vec<RecordBatch>] {
&self.partitions
}
+ /// Ref to projection
pub 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 schema
pub 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.rs
index 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.rs
index 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.rs
index 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(),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]