Function datafusion_expr::logical_plan::display::display_schema

source ยท
pub fn display_schema(schema: &Schema) -> impl Display + '_
Expand description

Print the schema in a compact representation to buf

For example: foo:Utf8 if foo can not be null, and foo:Utf8;N if foo is nullable.

use arrow::datatypes::{Field, Schema, DataType};
let schema = Schema::new(vec![
    Field::new("id", DataType::Int32, false),
    Field::new("first_name", DataType::Utf8, true),
 ]);

 assert_eq!(
     "[id:Int32, first_name:Utf8;N]",
     format!("{}", display_schema(&schema))
 );