morrySnow commented on code in PR #17755:
URL: https://github.com/apache/doris/pull/17755#discussion_r1134889318


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Substring.java:
##########
@@ -68,7 +68,7 @@ public Substring(Expression arg0, Expression arg1, Expression 
arg2) {
     @Override
     public FunctionSignature computeSignature(FunctionSignature signature) {
         Optional<Expression> length = arity() == 3
-                ? Optional.of(getArgument(2))
+                ? Optional.of(getArgument(1))

Review Comment:
   according [substr's 
manual](https://doris.apache.org/docs/dev/sql-manual/sql-functions/string-functions/substring/),
 the third arg is length. so we need to get length of return type from 
`getArgument(2)` or `getArgument(0).getDataType().len() - getArgument(1)`



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

Reply via email to