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 6e2ff2955d Derive Debug for logical plan nodes (#11757)
6e2ff2955d is described below
commit 6e2ff2955d96cacba905d24993353c7e5fe0cf93
Author: 张林伟 <[email protected]>
AuthorDate: Thu Aug 1 23:16:05 2024 +0800
Derive Debug for logical plan nodes (#11757)
---
datafusion/expr/src/logical_plan/plan.rs | 40 ++++++++++++++++----------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/datafusion/expr/src/logical_plan/plan.rs
b/datafusion/expr/src/logical_plan/plan.rs
index 54c857a2b7..6bea1ad948 100644
--- a/datafusion/expr/src/logical_plan/plan.rs
+++ b/datafusion/expr/src/logical_plan/plan.rs
@@ -1895,7 +1895,7 @@ impl ToStringifiedPlan for LogicalPlan {
}
/// Produces no rows: An empty relation with an empty schema
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct EmptyRelation {
/// Whether to produce a placeholder row
pub produce_one_row: bool,
@@ -1925,7 +1925,7 @@ pub struct EmptyRelation {
/// intermediate table, then empty the intermediate table.
///
/// [Postgres Docs]:
https://www.postgresql.org/docs/current/queries-with.html#QUERIES-WITH-RECURSIVE
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecursiveQuery {
/// Name of the query
pub name: String,
@@ -1942,7 +1942,7 @@ pub struct RecursiveQuery {
/// Values expression. See
/// [Postgres
VALUES](https://www.postgresql.org/docs/current/queries-values.html)
/// documentation for more details.
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Values {
/// The table schema
pub schema: DFSchemaRef,
@@ -2023,7 +2023,7 @@ pub fn projection_schema(input: &LogicalPlan, exprs:
&[Expr]) -> Result<Arc<DFSc
}
/// Aliased subquery
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
// mark non_exhaustive to encourage use of try_new/new()
#[non_exhaustive]
pub struct SubqueryAlias {
@@ -2071,7 +2071,7 @@ impl SubqueryAlias {
///
/// Filter should not be created directly but instead use `try_new()`
/// and that these fields are only pub to support pattern matching
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub struct Filter {
/// The predicate expression, which must have Boolean type.
@@ -2174,7 +2174,7 @@ impl Filter {
}
/// Window its input based on a set of window spec and window function (e.g.
SUM or RANK)
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Window {
/// The incoming logical plan
pub input: Arc<LogicalPlan>,
@@ -2368,7 +2368,7 @@ impl TableScan {
}
/// Apply Cross Join to two logical plans
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CrossJoin {
/// Left input
pub left: Arc<LogicalPlan>,
@@ -2379,7 +2379,7 @@ pub struct CrossJoin {
}
/// Repartition the plan based on a partitioning scheme.
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Repartition {
/// The incoming logical plan
pub input: Arc<LogicalPlan>,
@@ -2388,7 +2388,7 @@ pub struct Repartition {
}
/// Union multiple inputs
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Union {
/// Inputs to merge
pub inputs: Vec<Arc<LogicalPlan>>,
@@ -2398,7 +2398,7 @@ pub struct Union {
/// Prepare a statement but do not execute it. Prepare statements can have 0
or more
/// `Expr::Placeholder` expressions that are filled in during execution
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Prepare {
/// The name of the statement
pub name: String,
@@ -2430,7 +2430,7 @@ pub struct Prepare {
/// | parent_span_id | Utf8 | YES |
/// +--------------------+-----------------------------+-------------+
/// ```
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DescribeTable {
/// Table schema
pub schema: Arc<Schema>,
@@ -2440,7 +2440,7 @@ pub struct DescribeTable {
/// Produces a relation with string representations of
/// various parts of the plan
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Explain {
/// Should extra (detailed, intermediate plans) be included?
pub verbose: bool,
@@ -2456,7 +2456,7 @@ pub struct Explain {
/// Runs the actual plan, and then prints the physical plan with
/// with execution metrics.
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Analyze {
/// Should extra detail be included?
pub verbose: bool,
@@ -2471,7 +2471,7 @@ pub struct Analyze {
// the manual `PartialEq` is removed in favor of a derive.
// (see `PartialEq` the impl for details.)
#[allow(clippy::derived_hash_with_manual_eq)]
-#[derive(Clone, Eq, Hash)]
+#[derive(Debug, Clone, Eq, Hash)]
pub struct Extension {
/// The runtime extension operator
pub node: Arc<dyn UserDefinedLogicalNode>,
@@ -2487,7 +2487,7 @@ impl PartialEq for Extension {
}
/// Produces the first `n` tuples from its input and discards the rest.
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Limit {
/// Number of rows to skip before fetch
pub skip: usize,
@@ -2499,7 +2499,7 @@ pub struct Limit {
}
/// Removes duplicate rows from the input
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Distinct {
/// Plain `DISTINCT` referencing all selection expressions
All(Arc<LogicalPlan>),
@@ -2518,7 +2518,7 @@ impl Distinct {
}
/// Removes duplicate rows from the input
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DistinctOn {
/// The `DISTINCT ON` clause expression list
pub on_expr: Vec<Expr>,
@@ -2604,7 +2604,7 @@ impl DistinctOn {
/// Aggregates its input based on a set of grouping and aggregate
/// expressions (e.g. SUM).
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
// mark non_exhaustive to encourage use of try_new/new()
#[non_exhaustive]
pub struct Aggregate {
@@ -2767,7 +2767,7 @@ fn calc_func_dependencies_for_project(
}
/// Sorts its input according to a list of sort expressions.
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Sort {
/// The sort expressions
pub expr: Vec<Expr>,
@@ -2778,7 +2778,7 @@ pub struct Sort {
}
/// Join two logical plans on one or more join columns
-#[derive(Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Join {
/// Left input
pub left: Arc<LogicalPlan>,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]