/// Generate schema from JSON field names and inferred data types
Generate schema from JSON field names and inferred data types
Generate schema from JSON field names and inferred data types
fn generate_schema(spec: HashMap<String, HashSet<DataType>>) -> Schema {
    let fields: Vec<Field> = spec
        .iter()
        .map(|(k, hs)| {
            let v: Vec<&DataType> = hs.iter().collect();
            Field::new(k, coerce_data_type(&v), true)
        })
        .collect();
    Schema::new(fields)
}
fn generate_schema ( spec : HashMap < String , HashSet < DataType > > ) -> Schema { let fields : Vec < Field > = spec . iter ( ) . map ( | ( k , hs ) | { let v : Vec < & DataType > = hs . iter ( ) . collect ( ) ; Field :: new ( k , coerce_data_type ( & v ) , true ) } ) . collect ( ) ; Schema :: new ( fields ) }
Generate schema from JSON field names and inferred data types
Generate schema from JSON field names and inferred data types
spec
HashMap<String, HashSet<DataType>>