You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "LeoWangLZ (JIRA)" <ji...@apache.org> on 2018/01/05 02:37:00 UTC

[jira] [Commented] (CALCITE-2116) The digests are not same for the common sub-expressions in HepPlanner

    [ https://issues.apache.org/jira/browse/CALCITE-2116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16312397#comment-16312397 ] 

LeoWangLZ commented on CALCITE-2116:
------------------------------------

[~julianhyde] https://github.com/apache/calcite/pull/597
For the same subquery, we think they have same relNode, but when adding relNode to graph, the digest are not the same,
like testReplaceCommonSubexpression, for subquery "select * from dept", it's expected that the trees of relNode are same, but not.
The reason is that when finding the digest of one relNode by mapDigestToVertex, the digest is from constructor instead of recompute, so the digest can't contain the input of digest and it's not match for the same subquery.
and if the problem is fixed, the union has same inputs for the same subquery. and while executing the result, the source of union are the same, and get one row and remove it for ListSource, but it need be got twice, then the another source is removed at the same time because of the inputs are the same, so the code of ListSource would be modified that the row can't be removed

> The digests are not same for the common sub-expressions in HepPlanner
> ---------------------------------------------------------------------
>
>                 Key: CALCITE-2116
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2116
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.15.0
>            Reporter: LeoWangLZ
>            Assignee: Julian Hyde
>
> The digests are not same for the same sub-query.
> like query
> {code:java}
> select * from (select * from dept union all select * from dept)a;
> {code}
> When run the query, The union relNode has two inputs, and it's same expectly and it's the same object instead of the print of plan, but Now they are not same.
> And for Test testReplaceCommonSubexpression, the rule is only firing once, but now it's two.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)