You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Cliff Buchanan (JIRA)" <ji...@apache.org> on 2014/06/11 23:10:02 UTC

[jira] [Comment Edited] (DRILL-561) Drill fails to parse TRIM function

    [ https://issues.apache.org/jira/browse/DRILL-561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14028378#comment-14028378 ] 

Cliff Buchanan edited comment on DRILL-561 at 6/11/14 9:08 PM:
---------------------------------------------------------------

Attached patch to implement btrim as well as trim.

This patch enables productions like the following:
{code:sql}
trim(' ' FROM ' abc ')
trim(LEADING ' ' FROM ' abc ')
trim(LEADING FROM ' abc ')
trin(LEADING FROM ' abc ')
{code}
but not:
{code:sql}
trim(' abc ', ' ')
{code}
This production is supported in postgres, but is not part of SQL92 and not supported by optiq.

https://reviews.apache.org/r/22474/


was (Author: cbuchanan):
Attached patch to implement btrim as well as trim.

This patch enables productions like the following:
{code:sql}
trim(' ' FROM ' abc ')
trim(LEADING ' ' FROM ' abc ')
trim(LEADING FROM ' abc ')
trin(LEADING FROM ' abc ')
{code}
but not:
{code:sql}
trim(' abc ', ' ')
{code}
This production is supported in postgres, but is not part of SQL92 and not supported by optiq.

> Drill fails to parse TRIM function
> ----------------------------------
>
>                 Key: DRILL-561
>                 URL: https://issues.apache.org/jira/browse/DRILL-561
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.0.0
>            Reporter: Krystal
>            Assignee: Cliff Buchanan
>             Fix For: 1.0.0-BETA1
>
>         Attachments: DRILL-561.patch
>
>
> The following TRIM function failed:
> select trim(name) from voter where rownum=20;
> Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "06ab5b53-7781-44fb-ae8f-2c986065e952"
> endpoint {
>   address: "qa-node57.qa.lab"
>   user_port: 31010
>   control_port: 31011
>   data_port: 31012
> }
> error_type: 0
> message: "Failure while parsing sql. < ValidationException:[ java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 ] < IndexOutOfBoundsException:[ Index: 0, Size: 0 ]"
> ]



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