Omega359 commented on code in PR #11942:
URL: https://github.com/apache/datafusion/pull/11942#discussion_r1715698875
##########
datafusion/functions/src/unicode/rpad.rs:
##########
@@ -76,97 +84,168 @@ impl ScalarUDFImpl for RPadFunc {
}
fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
- match args[0].data_type() {
- DataType::Utf8 => make_scalar_function(rpad::<i32>, vec![])(args),
- DataType::LargeUtf8 => make_scalar_function(rpad::<i64>,
vec![])(args),
- other => exec_err!("Unsupported data type {other:?} for function
rpad"),
+ match args.len() {
+ 2 => match args[0].data_type() {
+ DataType::Utf8 | DataType::Utf8View => {
+ make_scalar_function(rpad::<i32, i32>, vec![])(args)
+ }
+ DataType::LargeUtf8 => {
+ make_scalar_function(rpad::<i64, i64>, vec![])(args)
+ }
+ other => exec_err!("Unsupported data type {other:?} for
function rpad"),
+ },
+ 3 => match (args[0].data_type(), args[2].data_type()) {
+ (
+ DataType::Utf8 | DataType::Utf8View,
+ DataType::Utf8 | DataType::Utf8View,
Review Comment:
This line looks to be a duplicate.
--
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]