MCPcopy Create free account
hub / github.com/apache/datafusion / explain_with_options

Method explain_with_options

datafusion/core/src/dataframe/mod.rs:1778–1793  ·  view source on GitHub ↗

Return a DataFrame with the explanation of its plan so far. `opt` is used to specify the options for the explain operation. Details of the options can be found in [`ExplainOption`]. ``` # use datafusion::prelude::*; # use datafusion::error::Result; # #[tokio::main] # async fn main() -> Result<()> { use datafusion_expr::{Explain, ExplainOption}; let ctx = SessionContext::new(); let df = ctx .read_

(
        self,
        explain_option: ExplainOption,
    )

Source from the content-addressed store, hash-verified

1776 /// # }
1777 /// ```
1778 pub fn explain_with_options(
1779 self,
1780 explain_option: ExplainOption,
1781 ) -> Result<DataFrame> {
1782 if matches!(self.plan, LogicalPlan::Explain(_)) {
1783 return plan_err!("Nested EXPLAINs are not supported");
1784 }
1785 let plan = LogicalPlanBuilder::from(self.plan)
1786 .explain_option_format(explain_option)?
1787 .build()?;
1788 Ok(DataFrame {
1789 session_state: self.session_state,
1790 plan,
1791 projection_requires_validation: self.projection_requires_validation,
1792 })
1793 }
1794
1795 /// Return a `FunctionRegistry` used to plan udf's calls
1796 ///

Callers 3

explainMethod · 0.80
benchmark_queryMethod · 0.80
runMethod · 0.80

Calls 2

explain_option_formatMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected