You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Abhishek Girish (JIRA)" <ji...@apache.org> on 2015/04/10 20:15:13 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 ]

Abhishek Girish updated DRILL-2751:
-----------------------------------
    Description: 
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}



  was:
Drill currently expects all literals in an expression to be enclosed in quotes, 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}




> 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: Query Planning & Optimization
>            Reporter: Abhishek Girish
>            Assignee: Jinfeng Ni
>
> 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)