[ 
https://issues.apache.org/jira/browse/IMPALA-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Armstrong updated IMPALA-3042:
----------------------------------
    Labels: newbie supportability  (was: supportability)

> substr() doesn't give warning for invalid start index
> -----------------------------------------------------
>
>                 Key: IMPALA-3042
>                 URL: https://issues.apache.org/jira/browse/IMPALA-3042
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>    Affects Versions: Impala 2.2
>            Reporter: Juan Yu
>            Priority: Minor
>              Labels: newbie, supportability
>
> substr requires an valid start index. however it returns empty string instead 
> of giving warning for invalid index.
> substr(string a, int start [, int len]), substring(string a, int start [, int 
> len])
> Purpose: Returns the portion of the string starting at a specified point, 
> optionally with a specified maximum length. The characters in the string are 
> *indexed starting at 1*.
> Return type: string
> {code}
> Query: select substr('hello', 0, 3)
> +-----------------------+
> | substr('hello', 0, 3) |
> +-----------------------+
> |                       |
> +-----------------------+
> Fetched 1 row(s) in 0.01s
> Query: select substr('hello', 1, 3)
> +-----------------------+
> | substr('hello', 1, 3) |
> +-----------------------+
> | hel                   |
> +-----------------------+
> Fetched 1 row(s) in 0.01s
> Query: select substr('hello', -5, 3)
> +------------------------+
> | substr('hello', -5, 3) |
> +------------------------+
> | hel                    |
> +------------------------+
> Fetched 1 row(s) in 0.01s
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to