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

Mehant Baid updated DRILL-575:
------------------------------

    Component/s: Functions - Drill

> RPAD/LPAD functions fails when padded string is not specified
> -------------------------------------------------------------
>
>                 Key: DRILL-575
>                 URL: https://issues.apache.org/jira/browse/DRILL-575
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.0.0
>            Reporter: Krystal
>
> In oracle and postgres, rpad and lpad functions defaults to spaces when str2 
> is not specified - rpad(str1, length [, str2]).  For example in oracle:
> SQL> select rpad(name,20) from voter where voter_id=10;
> RPAD(NAME,20)
> --------------------
> tom underhill
> SQL> select lpad(name,20) from voter where voter_id=10;
> LPAD(NAME,20)
> --------------------
>        tom underhill
> In drill, the queries fail because the str2 parameter is required:
> 0: jdbc:drill:schema=dfs> relect lpad(name, 20) from voter where voter_id=10;
> Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while 
> running query.[error_id: "dde5cf1c-1d05-46c4-902a-c4bd6621c065"
> endpoint {
>   address: "qa-node57.qa.lab"
>   user_port: 31010
>   control_port: 31011
>   data_port: 31012
> }
> error_type: 0
> message: "Failure while parsing sql. < SqlParseException:[ Non-query 
> expression encountered in illegal context ] < EigenbaseException:[ Non-query 
> expression encountered in illegal context ]"
> ]



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to