Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
parse_data_type in datafusion::sql - Rust
[go: Go Back, main page]

pub fn parse_data_type(val: &str) -> Result<DataType, DataFusionError>
Expand description

Parses str into a DataType.

parse_data_type is the the reverse of DataType’s Display impl, and maintains the invariant that parse_data_type(data_type.to_string()) == data_type

Example:

let display_value = "Int32";

// "Int32" is the Display value of `DataType`
assert_eq!(display_value, &format!("{}", DataType::Int32));

// parse_data_type coverts "Int32" back to `DataType`:
let data_type = parse_data_type(display_value).unwrap();
assert_eq!(data_type, DataType::Int32);

Remove if added to arrow: https://github.com/apache/arrow-rs/issues/3821