[
https://issues.apache.org/jira/browse/CALCITE-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15042650#comment-15042650
]
Julian Hyde commented on CALCITE-1007:
--------------------------------------
I thought that Calcite's policy was only to allow join conditions {{t1.x=t2.x}}
if t1.x and t2.x have IDENTICAL type. To make them identical, you might need to
wrap one side in a widening cast. So the algebra would be as if they'd written
{code}select *
from (select cast(1 as bigint) as x from t1) as t1
join (select stroll as x from t2) as t2
join t1.x = t2.x{code}
and there would not be a problem. So, the problem may be in allowing equi-join
conditions.
Yeah, you Hive guys like to berate me that Calcite is too strict about types.
Here's a case where strictness helps.
> Transitive Inference on Join Condition is not type safe
> -------------------------------------------------------
>
> Key: CALCITE-1007
> URL: https://issues.apache.org/jira/browse/CALCITE-1007
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.5.0
> Reporter: Laljo John Pullokkaran
> Assignee: Laljo John Pullokkaran
>
> select * from (select 1 as x from t1) t1 join (select stroll as x from t2)t2
> join t1.x=t2.x;
> While transferring x=1 from t1 to t2, we don't use the correct type for 'x'
> on t2.
> This could result in data correctness.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)