You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jacques Nadeau (JIRA)" <ji...@apache.org> on 2015/05/05 15:37:01 UTC

[jira] [Updated] (DRILL-2751) Implicit cast in filters fails if some literals in an expression are enclosed in quotes.

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

Jacques Nadeau updated DRILL-2751:
----------------------------------
      Component/s:     (was: Query Planning & Optimization)
                   SQL Parser
    Fix Version/s: 1.2.0

> Implicit cast in filters fails if some literals in an expression are enclosed in quotes. 
> -----------------------------------------------------------------------------------------
>
>                 Key: DRILL-2751
>                 URL: https://issues.apache.org/jira/browse/DRILL-2751
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: SQL Parser
>            Reporter: Abhishek Girish
>            Assignee: Jinfeng Ni
>             Fix For: 1.2.0
>
>
> Drill currently expects all literals in an expression to be enclosed in quotes (in case of implicit casts between numerals & Strings with numeral values), and fails otherwise. 
> *Drill: Between operator*
> {code:sql}
> >  select d_date_sk, d_day_name from date_dim where d_same_day_lq between 2400000 and '2500000' order by d_same_day_lq limit 3;
> Query failed: SqlValidatorException: Cannot apply 'BETWEEN' to arguments of type '<ANY> BETWEEN <INTEGER> AND <CHAR(7)>'. Supported form(s): '<COMPARABLE_TYPE> BETWEEN <COMPARABLE_TYPE> AND <COMPARABLE_TYPE>'
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> {code}
> *Postgres: Between operator*
> {code:sql}
> # select d_date_sk, d_day_name from date_dim where d_same_day_lq between 2400000 and '2500000' order by d_same_day_lq limit 3;
>  d_date_sk | d_day_name
> -----------+------------
>    2415022 | Monday
>    2415023 | Tuesday
>    2415024 | Wednesday
> (3 rows)
> {code}
> *Drill: IN operator*
> {code:sql}
> > select d_date_sk, d_day_name from date_dim where d_same_day_lq in ('2414930', 2414931) limit 5;
> Query failed: SqlValidatorException: Values in expression list must have compatible types
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> {code}
> *Postgres: IN operator*
> {code:sql}
> #  select d_date_sk, d_day_name from date_dim where d_same_day_lq in ('2414930', 2414931) limit 5;
>  d_date_sk | d_day_name
> -----------+------------
>    2415022 | Monday
>    2415023 | Tuesday
> (2 rows)
> {code}



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