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 19:33:13 UTC

[jira] [Updated] (DRILL-2747) Implicit cast in filters fails if enclosed literal has leading or trailing spaces

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

Abhishek Girish updated DRILL-2747:
-----------------------------------
    Summary: Implicit cast in filters fails if enclosed literal has leading or trailing spaces  (was: Implicit cast in filters fails if enclosed literal has trailing spaces)

> Implicit cast in filters fails if enclosed literal has leading or trailing spaces
> ---------------------------------------------------------------------------------
>
>                 Key: DRILL-2747
>                 URL: https://issues.apache.org/jira/browse/DRILL-2747
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Abhishek Girish
>            Assignee: Jinfeng Ni
>
> Implicit cast in filters fail if literals contain trailing spaces. 
> *Drill:*
> {code:sql}
> > select d_date_sk, d_day_name from date_dim where d_date is not null and d_date between '1900-01-10' and ' 1900-01-20'  limit 1 ;
> +------------+------------+
> | d_date_sk  | d_day_name |
> +------------+------------+
> +------------+------------+
> No rows selected (0.221 seconds)
> {code}
> Prefixing the literal with "date" happens to solve the issue:
> {code:sql}
> > select d_date_sk, d_day_name from date_dim where d_date is not null and d_date between date '1900-01-10' and date ' 1900-01-20'  limit 1 ;
> +------------+------------+
> | d_date_sk  | d_day_name |
> +------------+------------+
> | 2415030    | Tuesday    |
> +------------+------------+
> 1 row selected (0.128 seconds)
> {code}
> *Postgres:*
> {code:sql}
> # select d_date_sk, d_day_name from date_dim where d_date is not null and d_date between '1900-01-10' and ' 1900-01-20'  limit 1 ;
>  d_date_sk | d_day_name
> -----------+------------
>    2415030 | Tuesday
> (1 row)
> {code}



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