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/13 00:15:03 UTC

[jira] [Commented] (DRILL-739) SUBSTRING function with regex pattern fails to parse.

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

Cliff Buchanan commented on DRILL-739:
--------------------------------------

{{substring('string', 'regexp')}} isn't currently allowed by the optiq validator, so this will not be implemented for the beta release.

> SUBSTRING function with regex pattern fails to parse.
> -----------------------------------------------------
>
>                 Key: DRILL-739
>                 URL: https://issues.apache.org/jira/browse/DRILL-739
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: Krystal
>            Assignee: Cliff Buchanan
>             Fix For: 1.0.0-BETA1
>
>
> SUBSTRING(string from pattern) function fails to execute.  For example:
> select substring(name from '^.....') from voter where age < 20;
> message: "Failure while parsing sql. < ValidationException:[ org.eigenbase.util.EigenbaseContextException: From line 1, column 8 to line 1, column 36 ] < EigenbaseContextException:[ From line 1, column 8 to line 1, column 36 ] < SqlValidatorException:[ Cannot apply 'SUBSTRING' to arguments of type 'SUBSTRING(<ANY> FROM <CHAR(6)>)'. Supported form(s): 'SUBSTRING(<CHAR> FROM <INTEGER>)'
> 'SUBSTRING(<CHAR> FROM <INTEGER> FOR <INTEGER>)'
> 'SUBSTRING(<VARCHAR> FROM <INTEGER>)'
> 'SUBSTRING(<VARCHAR> FROM <INTEGER> FOR <INTEGER>)'
> 'SUBSTRING(<BINARY> FROM <INTEGER>)'
> 'SUBSTRING(<BINARY> FROM <INTEGER> FOR <INTEGER>)'
> 'SUBSTRING(<VARBINARY> FROM <INTEGER>)'
> 'SUBSTRING(<VARBINARY> FROM <INTEGER> FOR <INTEGER>)' ]"
> ]
> Same error for the following test queries:
> select substring(name from 's.n$') from student where rownum=105;
> select substring(name from '^[A-Z].*$') from voter where rownum=15;



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