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

Jinfeng Ni updated DRILL-2751:
------------------------------
    Fix Version/s:     (was: 1.2.0)
                   1.4.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.4.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)

Reply via email to