You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Venkata krishnan Sowrirajan (JIRA)" <ji...@apache.org> on 2014/12/10 08:25:12 UTC

[jira] [Commented] (DRILL-1831) LIKE operator not working with SQL [charlist] Wildcard

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

Venkata krishnan Sowrirajan commented on DRILL-1831:
----------------------------------------------------

I think as part of "like" operator [charlist] and [^charlist] are not supported. It is supported part of "similar" operator. This query works for me. 

"select columns[0] from `temp.tbl` where columns[0] similar to '[aq]%';". Similarly, it also works with other types of [charlist].

And also I checked in other SQL tools like MySQL and Oracle SQL, it is not supported in "like" operator.'
The below link shows which SQL tool supports [charlist]

http://stackoverflow.com/questions/712580/list-of-special-characters-for-sql-like-clause

> LIKE operator not working with SQL [charlist] Wildcard
> ------------------------------------------------------
>
>                 Key: DRILL-1831
>                 URL: https://issues.apache.org/jira/browse/DRILL-1831
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Operators
>            Reporter: Rahul Challapalli
>            Assignee: Venkata krishnan Sowrirajan
>
> git.commit.id.abbrev=142e577
> Data :
> {code}
> abc
> def
> acf
> fgh
> qjh
> {code}
> The below query works fine
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDir> select columns[0] from `data-shapes/temp.tbl` where columns[0] like '%b%';
> +------------+
> |   EXPR$0   |
> +------------+
> | abc        |
> +------------+
> 1 row selected (0.122 seconds)
> {code}
> However the below query does not return anything
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDir> select columns[0] from `data-shapes/temp.tbl` where columns[0] like '[aq]%';
> +------------+
> |   EXPR$0   |
> +------------+
> +------------+
> No rows selected (0.139 seconds)
> {code}
> The above query should return values which start with either 'a' or 'q'.
> Text Plan :
> {code}
> 00-00    Screen
> 00-01      Project(EXPR$0=[$0])
> 00-02        SelectionVectorRemover
> 00-03          Filter(condition=[LIKE($0, '[aq]%')])
> 00-04            Project(ITEM=[ITEM($0, 0)])
> 00-05              Scan(groupscan=[EasyGroupScan [selectionRoot=/drill/testdata/data-shapes/temp.tbl, numFiles=1, columns=[`columns`[0]], files=[maprfs:/drill/testdata/data-shapes/temp.tbl]]])
> {code}
> Let me know if you need anything else



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