MCPcopy Create free account
hub / github.com/apache/arrow-rs / get

Method get

arrow-csv/src/reader/mod.rs:234–251  ·  view source on GitHub ↗

Returns the inferred data type

(&self)

Source from the content-addressed store, hash-verified

232impl 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) {

Callers 11

string_to_timeFunction · 0.45
make_upscalerFunction · 0.45
make_downscalerFunction · 0.45
value_fieldFunction · 0.45
infer_schemaMethod · 0.45
parseFunction · 0.45
build_decimal_arrayFunction · 0.45
build_primitive_arrayFunction · 0.45
build_boolean_arrayFunction · 0.45
infer_field_schemaFunction · 0.45

Calls 2

TimestampClass · 0.85
leading_zerosMethod · 0.80

Tested by

no test coverage detected