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 424757f365 impored document string for plan builder (#10496)
424757f365 is described below
commit 424757f365ea9eab7b242f5b604ef804baecd666
Author: Abrar Khan <[email protected]>
AuthorDate: Tue May 14 18:03:18 2024 +0530
impored document string for plan builder (#10496)
---
datafusion/expr/src/logical_plan/builder.rs | 32 ++++++++++++++++++++---------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/datafusion/expr/src/logical_plan/builder.rs
b/datafusion/expr/src/logical_plan/builder.rs
index de832f6e38..3b1b1196f1 100644
--- a/datafusion/expr/src/logical_plan/builder.rs
+++ b/datafusion/expr/src/logical_plan/builder.rs
@@ -1147,22 +1147,34 @@ impl LogicalPlanBuilder {
}
/// Converts a `Arc<LogicalPlan>` into `LogicalPlanBuilder`
-/// fn employee_schema() -> Schema {
-/// Schema::new(vec![
-/// Field::new("id", DataType::Int32, false),
-/// Field::new("first_name", DataType::Utf8, false),
-/// Field::new("last_name", DataType::Utf8, false),
-/// Field::new("state", DataType::Utf8, false),
-/// Field::new("salary", DataType::Int32, false),
-/// ])
-/// }
+/// ```
+/// # use datafusion_expr::{Expr, expr, col, LogicalPlanBuilder,
logical_plan::table_scan};
+/// # use datafusion_common::Result;
+/// # use arrow::datatypes::{Schema, DataType, Field};
+/// # fn main() -> Result<()> {
+/// #
+/// # fn employee_schema() -> Schema {
+/// # Schema::new(vec![
+/// # Field::new("id", DataType::Int32, false),
+/// # Field::new("first_name", DataType::Utf8, false),
+/// # Field::new("last_name", DataType::Utf8, false),
+/// # Field::new("state", DataType::Utf8, false),
+/// # Field::new("salary", DataType::Int32, false),
+/// # ])
+/// # }
+/// #
+/// // Create the plan
/// let plan = table_scan(Some("employee_csv"), &employee_schema(),
Some(vec![3, 4]))?
/// .sort(vec![
/// Expr::Sort(expr::Sort::new(Box::new(col("state")), true, true)),
/// Expr::Sort(expr::Sort::new(Box::new(col("salary")), false, false)),
/// ])?
/// .build()?;
-/// let plan_builder: LogicalPlanBuilder = Arc::new(plan).into();
+/// // Convert LogicalPlan into LogicalPlanBuilder
+/// let plan_builder: LogicalPlanBuilder = std::sync::Arc::new(plan).into();
+/// # Ok(())
+/// # }
+/// ```
impl From<Arc<LogicalPlan>> for LogicalPlanBuilder {
fn from(plan: Arc<LogicalPlan>) -> Self {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]