diff --git a/extensions/functions_string.yaml b/extensions/functions_string.yaml index 7842e94eb..159988c47 100644 --- a/extensions/functions_string.yaml +++ b/extensions/functions_string.yaml @@ -53,6 +53,13 @@ scalar_functions: A `start` value of 1 refers to the first characters of the string. When `length` is not specified the function will extract a substring starting from position `start` and ending at the end of the string. + + The `negative_start` option applies to the `start` parameter. `WRAP_FROM_END` means + the index will start from the end of the `input` and move backwards. + The last character has an index of -1, the second to last character has an index of -2, + and so on. `LEFT_OF_BEGINNING` means the returned substring will start from + the left of the first character. A `start` of -1 will begin 2 characters left of the + the `input`, while a `start` of 0 begins 1 character left of the `input`. impls: - args: - value: "varchar" @@ -61,6 +68,9 @@ scalar_functions: name: "start" - value: i32 name: "length" + options: + negative_start: + values: [ WRAP_FROM_END, LEFT_OF_BEGINNING, ERROR ] return: "varchar" - args: - value: "string" @@ -69,6 +79,9 @@ scalar_functions: name: "start" - value: i32 name: "length" + options: + negative_start: + values: [ WRAP_FROM_END, LEFT_OF_BEGINNING, ERROR ] return: "string" - args: - value: "fixedchar" @@ -77,24 +90,36 @@ scalar_functions: name: "start" - value: i32 name: "length" + options: + negative_start: + values: [ WRAP_FROM_END, LEFT_OF_BEGINNING, ERROR ] return: "string" - args: - value: "varchar" name: "input" - value: i32 name: "start" + options: + negative_start: + values: [ WRAP_FROM_END, LEFT_OF_BEGINNING ] return: "varchar" - args: - value: "string" name: "input" - value: i32 name: "start" + options: + negative_start: + values: [ WRAP_FROM_END, LEFT_OF_BEGINNING ] return: "string" - args: - value: "fixedchar" name: "input" - value: i32 name: "start" + options: + negative_start: + values: [ WRAP_FROM_END, LEFT_OF_BEGINNING ] return: "string" - name: regexp_match_substring