Omega359 commented on code in PR #20803:
URL: https://github.com/apache/datafusion/pull/20803#discussion_r2911434981
##########
datafusion/functions/src/unicode/substr.rs:
##########
@@ -53,7 +53,7 @@ use datafusion_macros::user_doc;
standard_argument(name = "str", prefix = "String"),
argument(
name = "start_pos",
- description = "Character position to start the substring at. The first
character in the string has a position of 1."
+ description = "Character position to start the substring at. The first
character in the string has a position of 1. If the start position is less than
1, it is treated as if it is before the start of the string and the (absolute)
number of characters before position 1 is subtracted from `length` (if given).
For example, `substr('abc', -3, 6)` returns `'ab'`."
Review Comment:
Wow, ok. That behaviour is seriously weird. I would have expected negative
start to be from the end of the string, not invisible characters before the
start. TIL something.
--
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]