Omega359 commented on code in PR #20803:
URL: https://github.com/apache/datafusion/pull/20803#discussion_r2907047459
##########
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:
Is this a new behaviour? As far as I know this doesn't match postgresql's
behaviour (as described in the doc on get_true_start_end) where negative start
is not allowed. I think for PG the recommended approach there is to use the
right(..) function, for duckdb it's string slices.
--
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]