rohitrastogi commented on code in PR #399: URL: https://github.com/apache/datafusion-comet/pull/399#discussion_r1593390909
########## core/src/execution/datafusion/expressions/cast.rs: ########## @@ -191,44 +191,219 @@ macro_rules! cast_int_to_int_macro { .as_any() .downcast_ref::<PrimitiveArray<$from_arrow_primitive_type>>() .unwrap(); + let spark_int_literal_suffix = match $from_data_type { &DataType::Int64 => "L", &DataType::Int16 => "S", &DataType::Int8 => "T", _ => "", }; - let output_array = match $eval_mode { - EvalMode::Legacy => cast_array - .iter() - .map(|value| match value { - Some(value) => { - Ok::<Option<$to_native_type>, CometError>(Some(value as $to_native_type)) - } - _ => Ok(None), - }) - .collect::<Result<PrimitiveArray<$to_arrow_primitive_type>, _>>(), - _ => cast_array - .iter() - .map(|value| match value { - Some(value) => { + let output_array = cast_array Review Comment: Unrelated to core functionality of the pr: I made `cast_int_to_int_macro!` a little bit more idiomatic while replacing direct usage of the CastOverFlow struct with the new cast_overflow() function. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org