rohitrastogi commented on code in PR #399: URL: https://github.com/apache/datafusion-comet/pull/399#discussion_r1594420846
########## 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 + .iter() + .map(|value| match value { + Some(value) => match $eval_mode { + EvalMode::Legacy => Ok(Some(value as $to_native_type)), Review Comment: I reverted the change to cast_int_to_int and removed matches on eval_mode for the new macros. -- 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