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/10/20 17:29:05 UTC
[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #3902: Add `Substring(str [from int] [for int])` support in `datafusion-proto`
alamb commented on code in PR #3902:
URL: https://github.com/apache/arrow-datafusion/pull/3902#discussion_r1000921939
##########
datafusion/proto/src/from_proto.rs:
##########
@@ -1137,10 +1138,20 @@ pub fn parse_expr(
parse_expr(&args[0], registry)?,
parse_expr(&args[1], registry)?,
)),
- ScalarFunction::Substr => Ok(substr(
- parse_expr(&args[0], registry)?,
- parse_expr(&args[1], registry)?,
- )),
+ ScalarFunction::Substr => {
+ if args.len() > 2 {
Review Comment:
I recommend adding an assert `assert_eq!(args.len(), 3)` in this case so that we don't get another silent failure if we add additional argument support to substr
--
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