You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/14 09:49:26 UTC

[GitHub] [arrow-datafusion] Ted-Jiang opened a new pull request #2008: Support more ScalarFunction in Ballista

Ted-Jiang opened a new pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008


   # Which issue does this PR close?
   
   Closes #2007 .
   
    # Rationale for this change
   Now support more `ScalarFunction` in ballista. like "random"
   Before:
   ```
   select * from lineitem where l_quantity = random()*10;
   
   Internal("failed to serialize logical plan: General(\"Unsupported scalar function Random\")")
   ```
   Now:
   ```
   select * from lineitem where l_quantity = trunc(random() * 9 + 1) limit 3;
   +------------+-----------+-----------+--------------+------------+-----------------+------------+-------+--------------+--------------+------------+--------------+---------------+-------------------+------------+-------------------------+
   | l_orderkey | l_partkey | l_suppkey | l_linenumber | l_quantity | l_extendedprice | l_discount | l_tax | l_returnflag | l_linestatus | l_shipdate | l_commitdate | l_receiptdate | l_shipinstruct    | l_shipmode | l_comment               |
   +------------+-----------+-----------+--------------+------------+-----------------+------------+-------+--------------+--------------+------------+--------------+---------------+-------------------+------------+-------------------------+
   | 7          | 145243    | 7758      | 2            | 9          | 11594.16        | 0.08       | 0.08  | N            | O            | 1996-02-01 | 1996-03-02   | 1996-02-19    | TAKE BACK RETURN  | SHIP       | es. instructions        |
   | 35         | 120896    | 8433      | 3            | 7          | 13418.23        | 0.06       | 0.04  | N            | O            | 1996-01-19 | 1995-12-22   | 1996-01-29    | NONE              | MAIL       |  the carefully regular  |
   | 163        | 192642    | 5162      | 4            | 5          | 8673.2          | 0.02       | 0     | N            | O            | 1997-11-17 | 1997-10-09   | 1997-12-05    | DELIVER IN PERSON | TRUCK      |  must belie             |
   +------------+-----------+-----------+--------------+------------+-----------------+------------+-------+--------------+--------------+------------+--------------+---------------+-------------------+------------+-------------------------+
   3 rows in set. Query took 1.897 seconds.
   ```
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r827939571



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -979,8 +1008,6 @@ impl TryFrom<&protobuf::LogicalExprNode> for Expr {
                     ScalarFunction::Sin => Ok(sin((&args[0]).try_into()?)),
                     ScalarFunction::Cos => Ok(cos((&args[0]).try_into()?)),
                     ScalarFunction::Tan => Ok(tan((&args[0]).try_into()?)),
-                    // ScalarFunction::Asin => Ok(asin(&args[0]).try_into()?)),

Review comment:
       Opps,  forgot the deleted line, have added.




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r827921158



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -979,8 +1008,6 @@ impl TryFrom<&protobuf::LogicalExprNode> for Expr {
                     ScalarFunction::Sin => Ok(sin((&args[0]).try_into()?)),
                     ScalarFunction::Cos => Ok(cos((&args[0]).try_into()?)),
                     ScalarFunction::Tan => Ok(tan((&args[0]).try_into()?)),
-                    // ScalarFunction::Asin => Ok(asin(&args[0]).try_into()?)),

Review comment:
       Nullif is not in `expr.rs`. will address in another PR.




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] yjshen commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
yjshen commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r827836115



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -979,8 +1008,6 @@ impl TryFrom<&protobuf::LogicalExprNode> for Expr {
                     ScalarFunction::Sin => Ok(sin((&args[0]).try_into()?)),
                     ScalarFunction::Cos => Ok(cos((&args[0]).try_into()?)),
                     ScalarFunction::Tan => Ok(tan((&args[0]).try_into()?)),
-                    // ScalarFunction::Asin => Ok(asin(&args[0]).try_into()?)),

Review comment:
       I think the commented-out Asin, Acos, Concat, Array, Nullif, and md5 are removed?




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] doki23 commented on pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
doki23 commented on pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#issuecomment-1069197308


   may need a follow-up pr when #1969 merged


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] yjshen commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
yjshen commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r826972614



##########
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:
       Please let me know if it's ready for the next round of review.




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] yjshen commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r827680158



##########
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:
       @yjshen PTAL




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] liukun4515 commented on pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#issuecomment-1066756821


   Thanks, @Ted-Jiang  I will go through this pr later.


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] liukun4515 commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r825951399



##########
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:
       Can we fix the #2009 and #2010  in this pull request?




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r825782848



##########
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![]))
+                    // }
+                    // ScalarFunction::RegexpMatch => {
+                    //     Ok(regexp_match(vec![]))
+                    // }
+                    // ScalarFunction::Lpad => Ok(lpad(vec![])),
+                    //ScalarFunction::Btrim => Ok(btrim((&args[0]).try_into()?)),
+                    ScalarFunction::SplitPart => Ok(split_part(
+                        (&args[0]).try_into()?,
+                        (&args[1]).try_into()?,
+                        (&args[2]).try_into()?,
+                    )),
+                    ScalarFunction::StartsWith => {
+                        Ok(starts_with((&args[0]).try_into()?, (&args[1]).try_into()?))
+                    }
+                    ScalarFunction::Strpos => {
+                        Ok(strpos((&args[0]).try_into()?, (&args[1]).try_into()?))
+                    }
+                    ScalarFunction::Substr => {
+                        Ok(substr((&args[0]).try_into()?, (&args[1]).try_into()?))
+                    }
+                    ScalarFunction::ToHex => Ok(to_hex((&args[0]).try_into()?)),
+                    //ScalarFunction::ToTimestampMicros Ok(totime((&args[0]).try_into()?)),

Review comment:
       Add issue #2010 

##########
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:
       Add  issue #2009




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r827921158



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -979,8 +1008,6 @@ impl TryFrom<&protobuf::LogicalExprNode> for Expr {
                     ScalarFunction::Sin => Ok(sin((&args[0]).try_into()?)),
                     ScalarFunction::Cos => Ok(cos((&args[0]).try_into()?)),
                     ScalarFunction::Tan => Ok(tan((&args[0]).try_into()?)),
-                    // ScalarFunction::Asin => Ok(asin(&args[0]).try_into()?)),

Review comment:
       Nullif is not in `expr.rs`. will address in another PR.




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r825940057



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -992,32 +1017,88 @@ 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::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::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()?))
+                    }
+                    //issue https://github.com/apache/arrow-datafusion/issues/2009
+                    // ScalarFunction::ConcatWithSeparator => {
+                    //     Ok(concat_ws(vec![]))
+                    // }

Review comment:
       also related to #2009 😂




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] yjshen merged pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
yjshen merged pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008


   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r826739577



##########
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:
       Sure, will find a path how to fix these.




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Ted-Jiang commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
Ted-Jiang commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r825940057



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -992,32 +1017,88 @@ 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::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::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()?))
+                    }
+                    //issue https://github.com/apache/arrow-datafusion/issues/2009
+                    // ScalarFunction::ConcatWithSeparator => {
+                    //     Ok(concat_ws(vec![]))
+                    // }

Review comment:
       also related to #2009 




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] yjshen commented on a change in pull request #2008: Support more ScalarFunction in Ballista

Posted by GitBox <gi...@apache.org>.
yjshen commented on a change in pull request #2008:
URL: https://github.com/apache/arrow-datafusion/pull/2008#discussion_r825936924



##########
File path: datafusion-proto/src/from_proto.rs
##########
@@ -992,32 +1017,88 @@ 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::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::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()?))
+                    }
+                    //issue https://github.com/apache/arrow-datafusion/issues/2009
+                    // ScalarFunction::ConcatWithSeparator => {
+                    //     Ok(concat_ws(vec![]))
+                    // }

Review comment:
       `Concat` is removed here?




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org