[
https://issues.apache.org/jira/browse/CALCITE-710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14527449#comment-14527449
]
Sean Hsuan-Yi Chu commented on CALCITE-710:
-------------------------------------------
The issue comes from the fact that
In SqlToRelConverter.java, when we register subquery into subqueryList, we use
equalDeep to avoid registering the (logically) same instance twice. However,
when we lookup instances, we do not repeat the same logic.
There are two ways to tackle this issue.
1. Globally, less preferable:
Implement SqlNode's equals & hashCode methods to let subqueryMap perform
correctly. This does not sound preferable because it is way too global.
2. Locally, our patches working towards that direction:
When look up subqueries, perform the same logic as the way when ones were
registered. See thew pull request:
https://github.com/apache/incubator-calcite/pull/82
> Identical Conditions in the WHERE-CLAUSE caused assertion error
> ---------------------------------------------------------------
>
> Key: CALCITE-710
> URL: https://issues.apache.org/jira/browse/CALCITE-710
> Project: Calcite
> Issue Type: Bug
> Reporter: Sean Hsuan-Yi Chu
> Assignee: Julian Hyde
>
> The following is a simple example,
> select empno
> from EMP
> where deptno in (1, 2) or deptno in (1, 2)
> (Using AND can also reproduce this issue)
> We have two identical conditions in the where-clause. Queries falling in this
> pattern triggers assertion error (SqlToRelConverter.java:4083)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)