alamb commented on a change in pull request #9703: URL: https://github.com/apache/arrow/pull/9703#discussion_r593901579
########## File path: rust/datafusion/src/logical_plan/builder.rs ########## @@ -39,6 +39,43 @@ use crate::logical_plan::{DFField, DFSchema, DFSchemaRef, Partitioning}; use std::collections::HashSet; /// Builder for logical plans +/// +/// ``` +/// # use datafusion::prelude::*; +/// # use datafusion::logical_plan::LogicalPlanBuilder; +/// # use datafusion::error::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 a plan similar to Review comment: As I initially found the `impl IntoIterator<Item ....` syntax hard to grok, I figured I would add an example to `LogicalPlanBuilder` showing that it lets you use `vec![]` and the trait business can be somewhat ignored ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org