Returns the inferred data type
(&self)
| 232 | impl InferredDataType { |
| 233 | /// Returns the inferred data type |
| 234 | fn get(&self) -> DataType { |
| 235 | match self.packed { |
| 236 | 0 => DataType::Null, |
| 237 | 1 => DataType::Boolean, |
| 238 | 2 => DataType::Int64, |
| 239 | 4 | 6 => DataType::Float64, // Promote Int64 to Float64 |
| 240 | b if b != 0 && (b & !0b11111000) == 0 => match b.leading_zeros() { |
| 241 | // Promote to highest precision temporal type |
| 242 | 8 => DataType::Timestamp(TimeUnit::Nanosecond, None), |
| 243 | 9 => DataType::Timestamp(TimeUnit::Microsecond, None), |
| 244 | 10 => DataType::Timestamp(TimeUnit::Millisecond, None), |
| 245 | 11 => DataType::Timestamp(TimeUnit::Second, None), |
| 246 | 12 => DataType::Date32, |
| 247 | _ => unreachable!(), |
| 248 | }, |
| 249 | _ => DataType::Utf8, |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | /// Updates the [`InferredDataType`] with the given string |
| 254 | fn update(&mut self, string: &str) { |
no test coverage detected