fn infer_field_schema(string: &str) -> ArrowDataType {
    // when quoting is enabled in the reader, these quotes aren't escaped, we default to
    // Utf8 for them
    if string.starts_with('"') {
        return ArrowDataType::Utf8;
    }
    // match regex in a particular order
    let lower = string.to_ascii_lowercase();
    if lower == "true" || lower == "false" {
        return ArrowDataType::Boolean;
    }
    let skip_minus = if string.starts_with('-') { 1 } else { 0 };

    let mut parts = string[skip_minus..].split('.');
    let (left, right) = (parts.next(), parts.next());
    let left_is_number = left.map_or(false, all_digit);
    if left_is_number && right.map_or(false, all_digit) {
        return ArrowDataType::Float64;
    } else if left_is_number {
        return ArrowDataType::Int64;
    }
    ArrowDataType::Utf8
}
/// Infer the data type of a record
Infer the data type of a record
Infer the data type of a record
fn infer_field_schema(string: &str) -> ArrowDataType {
    // when quoting is enabled in the reader, these quotes aren't escaped, we default to
    // Utf8 for them
    if string.starts_with('"') {
        return ArrowDataType::Utf8;
    }
    // match regex in a particular order
    let lower = string.to_ascii_lowercase();
    if lower == "true" || lower == "false" {
        return ArrowDataType::Boolean;
    }
    let skip_minus = if string.starts_with('-') { 1 } else { 0 };
    let mut parts = string[skip_minus..].split('.');
    let (left, right) = (parts.next(), parts.next());
    let left_is_number = left.map_or(false, all_digit);
    if left_is_number && right.map_or(false, all_digit) {
        return ArrowDataType::Float64;
    } else if left_is_number {
        return ArrowDataType::Int64;
    }
    ArrowDataType::Utf8
}
fn infer_field_schema ( string : & str ) -> ArrowDataType { // when quoting is enabled in the reader, these quotes aren't escaped, we default to // Utf8 for them if string . starts_with ( '"' ) { return ArrowDataType :: Utf8 ; } // match regex in a particular order let lower = string . to_ascii_lowercase ( ) ; if lower == " " || lower == " " { return ArrowDataType :: Boolean ; } let skip_minus = if string . starts_with ( '-' ) { 1 } else { 0 } ; let mut parts = string [ skip_minus .. ] . split ( '.' ) ; let ( left , right ) = ( parts . next ( ) , parts . next ( ) ) ; let left_is_number = left . map_or ( false , all_digit ) ; if left_is_number && right . map_or ( false , all_digit ) { return ArrowDataType :: Float64 ; } else if left_is_number { return ArrowDataType :: Int64 ; } ArrowDataType :: Utf8 }
Infer the data type of a record
Infer the data type of a record
string
&str
string
&str