yjshen commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r826624259



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -992,32 +1017,86 @@ impl TryFrom<&protobuf::LogicalExprNode> for Expr {
                     ScalarFunction::Trunc => Ok(trunc((&args[0]).try_into()?)),
                     ScalarFunction::Abs => Ok(abs((&args[0]).try_into()?)),
                     ScalarFunction::Signum => 
Ok(signum((&args[0]).try_into()?)),
-                    ScalarFunction::Octetlength => {
+                    ScalarFunction::OctetLength => {
                         Ok(octet_length((&args[0]).try_into()?))
                     }
-                    // // ScalarFunction::Concat => 
Ok(concat((&args[0]).try_into()?)),
                     ScalarFunction::Lower => Ok(lower((&args[0]).try_into()?)),
                     ScalarFunction::Upper => Ok(upper((&args[0]).try_into()?)),
                     ScalarFunction::Trim => Ok(trim((&args[0]).try_into()?)),
                     ScalarFunction::Ltrim => Ok(ltrim((&args[0]).try_into()?)),
                     ScalarFunction::Rtrim => Ok(rtrim((&args[0]).try_into()?)),
-                    // ScalarFunction::Totimestamp => 
Ok(to_timestamp((&args[0]).try_into()?)),
-                    // ScalarFunction::Array => 
Ok(array((&args[0]).try_into()?)),
-                    // // ScalarFunction::Nullif => 
Ok(nulli((&args[0]).try_into()?)),
-                    ScalarFunction::Datepart => {
+                    ScalarFunction::DatePart => {
                         Ok(date_part((&args[0]).try_into()?, 
(&args[1]).try_into()?))
                     }
-                    ScalarFunction::Datetrunc => {
+                    ScalarFunction::DateTrunc => {
                         Ok(date_trunc((&args[0]).try_into()?, 
(&args[1]).try_into()?))
                     }
-                    // ScalarFunction::Md5 => Ok(md5((&args[0]).try_into()?)),
                     ScalarFunction::Sha224 => 
Ok(sha224((&args[0]).try_into()?)),
                     ScalarFunction::Sha256 => 
Ok(sha256((&args[0]).try_into()?)),
                     ScalarFunction::Sha384 => 
Ok(sha384((&args[0]).try_into()?)),
                     ScalarFunction::Sha512 => 
Ok(sha512((&args[0]).try_into()?)),
                     ScalarFunction::Digest => {
                         Ok(digest((&args[0]).try_into()?, 
(&args[1]).try_into()?))
                     }
+                    //ScalarFunction::ToTimestampMillis => Ok(to_tome)
+                    ScalarFunction::Ascii => Ok(ascii((&args[0]).try_into()?)),
+                    ScalarFunction::BitLength => Ok((&args[0]).try_into()?),
+                    ScalarFunction::CharacterLength => {
+                        Ok(character_length((&args[0]).try_into()?))
+                    }
+                    ScalarFunction::Chr => Ok(chr((&args[0]).try_into()?)),
+                    // ScalarFunction::ConcatWithSeparator => {
+                    //     Ok(concat_ws((&args[0]).try_into()?, 
(&args[1]).try_into()?))
+                    // }
+                    ScalarFunction::InitCap => 
Ok(ascii((&args[0]).try_into()?)),
+                    ScalarFunction::Left => {
+                        Ok(left((&args[0]).try_into()?, 
(&args[1]).try_into()?))
+                    }
+                    ScalarFunction::Random => Ok(random()),
+                    ScalarFunction::Repeat => {
+                        Ok(repeat((&args[0]).try_into()?, 
(&args[1]).try_into()?))
+                    }
+                    ScalarFunction::Replace => Ok(replace(
+                        (&args[0]).try_into()?,
+                        (&args[1]).try_into()?,
+                        (&args[2]).try_into()?,
+                    )),
+                    ScalarFunction::Reverse => 
Ok(reverse((&args[0]).try_into()?)),
+                    ScalarFunction::Right => {
+                        Ok(right((&args[0]).try_into()?, 
(&args[1]).try_into()?))
+                    }
+                    // ScalarFunction::Rpad => Ok(rpad(vec![])),
+                    // ScalarFunction::RegexpReplace => {
+                    //     Ok(regexp_replace(vec![]))
+                    // }

Review comment:
       I agree that we should implement these functions in this pr as much as 
possible. Only leave the controversial ones.




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


Reply via email to