drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mehant Baid (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-1125) Implicit cast not working in the join condition
Date Mon, 22 Sep 2014 03:00:33 GMT

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

Mehant Baid updated DRILL-1125:
-------------------------------
    Attachment: DRILL-1125.patch

In the above query one side of the join condition is varchar, the other is int. I think SQL
standard requires you to have an explicit cast while casting to or from a varchar in a join
condition. I tried a similar query on postgres and got an error to that effect.

However for other cases when implicit cast is allowed, for example when the join condition
involves int on one side and float on the other we should be able handle that case. This patch
solves this issue.

> Implicit cast not working in the join condition
> -----------------------------------------------
>
>                 Key: DRILL-1125
>                 URL: https://issues.apache.org/jira/browse/DRILL-1125
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types, Query Planning & Optimization
>            Reporter: Rahul Challapalli
>            Assignee: Mehant Baid
>             Fix For: 0.6.0
>
>         Attachments: DRILL-1125.patch, donuts.json, prices.json
>
>
> git.commit.id.abbrev=810a204
> Build # 26322
> In the below query there is no type attached to 'donuts.id' but we expect implicit cast
to work in this case. Data files referenced are also attached
> create view v1 as select cast(id as int) a, cast(price as double) b from prices;
> select v1.a from v1 inner join donuts on v1.a = donuts.id;
> Error From Sqlline : UnsupportedOperationException:[ Failure finding function that runtime
code generation expected.  Signature: compare_to( INT:OPTIONALVARCHAR:OPTIONAL,  ) returns
INT:REQUIRED ]
> With slight modification the below query works
> select v1.a from v1 inner join donuts on v1.a = donuts.id + 1 -1;



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

Mime
View raw message