cast_by_type

Function cast_by_type 

Source
pub fn cast_by_type(
    data: &RecordBatch,
    from_type: &DataType,
    to_type: &DataType,
    allow_cast_fail: bool,
) -> Result<RecordBatch>
Expand description

Casts all columns with from_type to to_type.

Returns error if casting a row fails and allow_cast_fail is set to false. Writes null to output if casting a row fails and allow_cast_fail is set to true.