Skip to main content

ExplainFormat

Enum ExplainFormat 

Source
pub enum ExplainFormat {
    Indent,
    Tree,
    PostgresJSON,
    Graphviz,
}
Expand description

Output formats for controlling for Explain plans

Variants§

§

Indent

Indent mode

Example:

> explain format indent select x from values (1) t(x);
+---------------+-----------------------------------------------------+
| plan_type     | plan                                                |
+---------------+-----------------------------------------------------+
| logical_plan  | SubqueryAlias: t                                    |
|               |   Projection: column1 AS x                          |
|               |     Values: (Int64(1))                              |
| physical_plan | ProjectionExec: expr=[column1@0 as x]               |
|               |   DataSourceExec: partitions=1, partition_sizes=[1] |
|               |                                                     |
+---------------+-----------------------------------------------------+
§

Tree

Tree mode

Example:

> explain format tree select x from values (1) t(x);
+---------------+-------------------------------+
| plan_type     | plan                          |
+---------------+-------------------------------+
| physical_plan | ┌───────────────────────────┐ |
|               | │       ProjectionExec      │ |
|               | │    --------------------   │ |
|               | │        x: column1@0       │ |
|               | └─────────────┬─────────────┘ |
|               | ┌─────────────┴─────────────┐ |
|               | │       DataSourceExec      │ |
|               | │    --------------------   │ |
|               | │         bytes: 128        │ |
|               | │       format: memory      │ |
|               | │          rows: 1          │ |
|               | └───────────────────────────┘ |
|               |                               |
+---------------+-------------------------------+
§

PostgresJSON

Postgres Json mode

A displayable structure that produces plan in postgresql JSON format.

Users can use this format to visualize the plan in existing plan visualization tools, for example dalibo

Example:

> explain format pgjson select x from values (1) t(x);
+--------------+--------------------------------------+
| plan_type    | plan                                 |
+--------------+--------------------------------------+
| logical_plan | [                                    |
|              |   {                                  |
|              |     "Plan": {                        |
|              |       "Alias": "t",                  |
|              |       "Node Type": "Subquery",       |
|              |       "Output": [                    |
|              |         "x"                          |
|              |       ],                             |
|              |       "Plans": [                     |
|              |         {                            |
|              |           "Expressions": [           |
|              |             "column1 AS x"           |
|              |           ],                         |
|              |           "Node Type": "Projection", |
|              |           "Output": [                |
|              |             "x"                      |
|              |           ],                         |
|              |           "Plans": [                 |
|              |             {                        |
|              |               "Node Type": "Values", |
|              |               "Output": [            |
|              |                 "column1"            |
|              |               ],                     |
|              |               "Plans": [],           |
|              |               "Values": "(Int64(1))" |
|              |             }                        |
|              |           ]                          |
|              |         }                            |
|              |       ]                              |
|              |     }                                |
|              |   }                                  |
|              | ]                                    |
+--------------+--------------------------------------+
§

Graphviz

Graphviz mode

Example:

> explain format graphviz select x from values (1) t(x);
+--------------+------------------------------------------------------------------------+
| plan_type    | plan                                                                   |
+--------------+------------------------------------------------------------------------+
| logical_plan |                                                                        |
|              | // Begin DataFusion GraphViz Plan,                                     |
|              | // display it online here: https://dreampuf.github.io/GraphvizOnline   |
|              |                                                                        |
|              | digraph {                                                              |
|              |   subgraph cluster_1                                                   |
|              |   {                                                                    |
|              |     graph[label="LogicalPlan"]                                         |
|              |     2[shape=box label="SubqueryAlias: t"]                              |
|              |     3[shape=box label="Projection: column1 AS x"]                      |
|              |     2 -> 3 [arrowhead=none, arrowtail=normal, dir=back]                |
|              |     4[shape=box label="Values: (Int64(1))"]                            |
|              |     3 -> 4 [arrowhead=none, arrowtail=normal, dir=back]                |
|              |   }                                                                    |
|              |   subgraph cluster_5                                                   |
|              |   {                                                                    |
|              |     graph[label="Detailed LogicalPlan"]                                |
|              |     6[shape=box label="SubqueryAlias: t\nSchema: [x:Int64;N]"]         |
|              |     7[shape=box label="Projection: column1 AS x\nSchema: [x:Int64;N]"] |
|              |     6 -> 7 [arrowhead=none, arrowtail=normal, dir=back]                |
|              |     8[shape=box label="Values: (Int64(1))\nSchema: [column1:Int64;N]"] |
|              |     7 -> 8 [arrowhead=none, arrowtail=normal, dir=back]                |
|              |   }                                                                    |
|              | }                                                                      |
|              | // End DataFusion GraphViz Plan                                        |
|              |                                                                        |
+--------------+------------------------------------------------------------------------+

Trait Implementations§

Source§

impl Clone for ExplainFormat

Source§

fn clone(&self) -> ExplainFormat

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConfigField for ExplainFormat

Source§

fn visit<V>(&self, v: &mut V, key: &str, description: &'static str)
where V: Visit,

Source§

fn set(&mut self, _: &str, value: &str) -> Result<(), DataFusionError>

Source§

fn reset(&mut self, key: &str) -> Result<(), DataFusionError>

Source§

impl Debug for ExplainFormat

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for ExplainFormat

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for ExplainFormat

Source§

impl FromStr for ExplainFormat

Implement parsing strings to ExplainFormat

Source§

type Err = DataFusionError

The associated error which can be returned from parsing.
Source§

fn from_str( format: &str, ) -> Result<ExplainFormat, <ExplainFormat as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for ExplainFormat

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ExplainFormat

Source§

fn eq(&self, other: &ExplainFormat) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ExplainFormat

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynEq for T
where T: Eq + Any,

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

impl<T> DynHash for T
where T: Hash + Any,

Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.