You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Haisheng Yuan (Jira)" <ji...@apache.org> on 2020/03/15 16:53:00 UTC

[jira] [Comment Edited] (CALCITE-3851) Replace the node importance map with a set for pruned nodes

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

Haisheng Yuan edited comment on CALCITE-3851 at 3/15/20, 4:52 PM:
------------------------------------------------------------------

{{String}} is immutable, but it has mutable field {{hash}}, once {{hash}} is set, it can't be changed again. The {{pruned}} field of {{AbstractRelNode}} serves the same purpose of {{String.hash}}. It doesn't participate in the computation of equals(), hashcode(), digest etc. of a RelNode. {{pruned}} can also be its own state of {{RelNode}}. Once it is pruned, it can't be un-pruned. It doesn't needs to be planner state. Pruned relnode should not be passed across different planner, otherwise, it is planner's bug, some pruned relnode is still used.


was (Author: hyuan):
{{String}} is immutable, but it has mutable field {{hash}}, once {{hash}} is set, it can't be changed again. The {{pruned}} field of {{AbstractRelNode}} serves the same purpose of {{String.hash}}. {{pruned}} can also be its own state of {{RelNode}}. Once it is pruned, it can't be un-pruned. It doesn't needs to planner state. Pruned relnode should not passed across different planner, otherwise, it is planner's bug, some pruned relnode is still used.

> Replace the node importance map with a set for pruned nodes
> -----------------------------------------------------------
>
>                 Key: CALCITE-3851
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3851
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Liya Fan
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Currently, volcano planner stores rel node importances with a map. In fact, the value of the map can only be 0. 
> So there is no need to store the values, and we replace the map with a set to store nodes whose importances are 0. 
> This makes the code logic clearer, and avoids instability caused by comparing floating point values. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)