shruti2522 commented on code in PR #17100: URL: https://github.com/apache/datafusion/pull/17100#discussion_r2267460117
########## datafusion/functions/src/unicode/lpad.rs: ########## @@ -253,17 +260,10 @@ where } let graphemes = string.graphemes(true).collect::<Vec<&str>>(); - let fill_chars = fill.chars().collect::<Vec<char>>(); - if length < graphemes.len() { builder.append_value(graphemes[..length].concat()); - } else if fill_chars.is_empty() { - builder.append_value(string); } else { - for l in 0..length - graphemes.len() { - let c = *fill_chars.get(l % fill_chars.len()).unwrap(); - builder.write_char(c)?; - } + builder.write_str(" ".repeat(length - graphemes.len()).as_str())?; Review Comment: [B] simplified `fill_array.is_none() + unwrap()` to `if let Some(fill_array) = fill_array` -- 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