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


##########
native/spark-expr/src/static_invoke/char_varchar_utils/read_side_padding.rs:
##########
@@ -204,14 +204,21 @@ fn spark_read_side_padding_internal<T: OffsetSizeTrait>(
             );
 
             for (string, length) in string_array.iter().zip(int_pad_array) {
+                let length = length.unwrap();
                 match string {
-                    Some(string) => builder.append_value(add_padding_string(
-                        string.parse().unwrap(),
-                        length.unwrap() as usize,
-                        truncate,
-                        pad_string,
-                        is_left_pad,
-                    )?),
+                    Some(string) => {
+                        if length < 0 {

Review Comment:
   its better to put happy path first in `if` stmt for compute intensive parts, 
so CPU won't have to execute eagerly instructions and then fall it back 



-- 
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