You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jinfeng Ni (JIRA)" <ji...@apache.org> on 2015/07/02 23:43:05 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=14612578#comment-14612578 ] 

Jinfeng Ni commented on DRILL-2751:
-----------------------------------

The cases in this JIRA seems not a common one. Plus, there is an easy workaround; just make sure all the operands have the same types in the query.  Given that, I bumped this JIRA from 1.2.0 to 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)