comphead commented on code in PR #3048:
URL: https://github.com/apache/datafusion-comet/pull/3048#discussion_r2673065521


##########
native/spark-expr/src/conversion_funcs/cast.rs:
##########
@@ -1960,88 +2009,71 @@ fn spark_cast_nonintegral_numeric_to_integral(
     }
 }
 
-/// Equivalent to org.apache.spark.unsafe.types.UTF8String.toByte
-fn cast_string_to_i8(str: &str, eval_mode: EvalMode) -> 
SparkResult<Option<i8>> {
-    Ok(cast_string_to_int_with_range_check(
-        str,
-        eval_mode,
-        "TINYINT",
-        i8::MIN as i32,
-        i8::MAX as i32,
-    )?
-    .map(|v| v as i8))
-}
-
-/// Equivalent to org.apache.spark.unsafe.types.UTF8String.toShort
-fn cast_string_to_i16(str: &str, eval_mode: EvalMode) -> 
SparkResult<Option<i16>> {
-    Ok(cast_string_to_int_with_range_check(
-        str,
-        eval_mode,
-        "SMALLINT",
-        i16::MIN as i32,
-        i16::MAX as i32,
-    )?
-    .map(|v| v as i16))
+fn parse_string_to_i8_legacy(str: &str) -> SparkResult<Option<i8>> {
+    match do_parse_string_to_int_legacy::<i32>(str, i32::MIN)? {
+        None => Ok(None),

Review Comment:
   ```suggestion
   ```
   ?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to