liukun4515 commented on issue #1488:
URL: 
https://github.com/apache/arrow-datafusion/issues/1488#issuecomment-1001286987


   ```
   /// Infer the data type of a record
   fn infer_field_schema(string: &str) -> DataType {
       // when quoting is enabled in the reader, these quotes aren't escaped, 
we default to
       // Utf8 for them
       if string.starts_with('"') {
           return DataType::Utf8;
       }
       // match regex in a particular order
       if BOOLEAN_RE.is_match(string) {
           DataType::Boolean
       } else if DECIMAL_RE.is_match(string) {
           DataType::Float64
       } else if INTEGER_RE.is_match(string) {
           DataType::Int64
       } else if DATETIME_RE.is_match(string) {
           DataType::Date64
       } else if DATE_RE.is_match(string) {
           DataType::Date32
       } else {
           DataType::Utf8
       }
   }
   ```
   The DECIMAL_RE IS `static ref DECIMAL_RE: Regex = 
Regex::new(r"^-?(\d*\.\d+|\d+\.\d*)$").unwrap();`
   
   @matthewmturner 
   I think the format of the float may be not matched the `DECIMAL_RE`.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to