[
https://issues.apache.org/jira/browse/DRILL-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14395020#comment-14395020
]
Mehant Baid commented on DRILL-2244:
------------------------------------
One thing to note here is that the implicit cast in joins will not work for
decimal data type. This is fine as we are not planning to focus on decimal
until after 1.0
> Implicit cast between numeric data type in joins
> ------------------------------------------------
>
> Key: DRILL-2244
> URL: https://issues.apache.org/jira/browse/DRILL-2244
> Project: Apache Drill
> Issue Type: Improvement
> Components: Execution - Codegen
> Affects Versions: 0.8.0
> Reporter: Victoria Markman
> Assignee: Mehant Baid
> Fix For: 0.9.0
>
> Attachments: DRILL-2244.patch
>
>
> I created two tables in drill with the following schema:
> t1.c1 - decimal(8,2)
> t2.c1 - decimal(18,4)
> Attempt to join on these columns produces run time error on not implemented
> compare function.
> Since we do support cast from INT to BIGINT, this behavior is inconsistent.
> {code}
> 0: jdbc:drill:schema=dfs> select * from x1, x2 where x1.c1 = x2.c1;
> Query failed: RemoteRpcException: Failure while running fragment., Failure
> finding function that runtime code generation expected. Signature:
> compare_to( DECIMAL9:OPTIONALDECIMAL18:OPTIONAL, ) returns INT:REQUIRED [
> 53049aa6-7165-4e5a-9dc5-9efa832b4e49 on atsqa4-134.qa.lab:31010 ]
> [ 53049aa6-7165-4e5a-9dc5-9efa832b4e49 on atsqa4-134.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query.
> (state=,code=0)
> {code}
> Explicit cast works:
> {code}
> 0: jdbc:drill:schema=dfs> select * from x1 left outer join x2 on cast(x1.c1
> as decimal(18,2)) = x2.c1;
> +------------+------------+
> | c1 | c10 |
> +------------+------------+
> | 1032.65 | null |
> +------------+------------+
> 1 row selected (0.137 seconds)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)