[ 
https://issues.apache.org/jira/browse/HIVE-17077?focusedWorklogId=450119&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-450119
 ]

ASF GitHub Bot logged work on HIVE-17077:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Jun/20 00:26
            Start Date: 24/Jun/20 00:26
    Worklog Time Spent: 10m 
      Work Description: github-actions[bot] closed pull request #203:
URL: https://github.com/apache/hive/pull/203


   


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 450119)
    Time Spent: 20m  (was: 10m)

> Hive should raise StringIndexOutOfBoundsException when LPAD/RPAD len 
> character's value is negative number
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-17077
>                 URL: https://issues.apache.org/jira/browse/HIVE-17077
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Lingang Deng
>            Assignee: Lingang Deng
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> lpad(rpad) throw a exception when the second argument a negative number, as 
> follows,
> {code:java}
> hive> select lpad("hello", -1 ,"h");
> FAILED: StringIndexOutOfBoundsException String index out of range: -1
> hive> select rpad("hello", -1 ,"h");
> FAILED: StringIndexOutOfBoundsException String index out of range: -1
> {code}
> Maybe we should return friendly result such as mysql.
> {code:java}
> mysql> select lpad("hello", -1 ,"h");
> +----------------------+
> | lpad("hello", -1 ,"h") |
> +----------------------+
> | NULL                 |
> +----------------------+
> 1 row in set (0.00 sec)
> mysql> select rpad("hello", -1 ,"h");
> +----------------------+
> | rpad("hello", -1 ,"h") |
> +----------------------+
> | NULL                 |
> +----------------------+
> 1 row in set (0.00 sec)
> {code}



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

Reply via email to