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

Patrick Toole commented on DRILL-2658:
--------------------------------------

It appears the alias version of "substr" does not work (substring):
0: jdbc:drill:> select substr('a','b') from sys.version;
+---------+
| EXPR$0  |
+---------+
| null    |
+---------+
1 row selected (0.288 seconds)
0: jdbc:drill:> select substring('a','b') from sys.version;
Error: PARSE ERROR: From line 1, column 8 to line 1, column 25: Cannot apply 
'SUBSTRING' to arguments of type 'SUBSTRING(<CHAR(1)> FROM <CHAR(1)>)'. 
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>)'



> Add ilike and regex substring functions
> ---------------------------------------
>
>                 Key: DRILL-2658
>                 URL: https://issues.apache.org/jira/browse/DRILL-2658
>             Project: Apache Drill
>          Issue Type: New Feature
>          Components: Functions - Drill
>            Reporter: Steven Phillips
>            Assignee: Steven Phillips
>             Fix For: 1.0.0
>
>         Attachments: DRILL-2658.patch, DRILL-2658.patch
>
>
> This will not modify the parser, so postgress syntax such as:
> "... where c ILIKE '%ABC%'"
> will not be currently supported. It will simply be a function:
> "... where ILIKE(c, '%ABC%')"
> Same for substring:
> "select substr(c, 'abc')..."
> will be equivalent to postgress
> "select substr(c from 'abc')",
> but 'abc' will be treated as a java regex pattern.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to