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

Julian Hyde commented on CALCITE-3167:
--------------------------------------

I disagree with your point 2. For some purposes, you might want two {{RelNode}} 
instances to be equal if and only if their {{id}} fields are equal. For other 
purposes, you might want two {{RelNode}} instances to be equal if and only if 
their {{digest}} fields are equal. I think it is better that the people 
designing those algorithms are explicit about how they define equality, and use 
maps based on particular fields to achieve the behavior they want.

I agree on your other points. If we are accidentally breaking CALCITE-1216 with 
this change, I trust its authors to speak up; we've done our best, because we 
have run the tests they provided.

> Remove overriding equals and hashCode methods in EnumerableTableScan
> --------------------------------------------------------------------
>
>                 Key: CALCITE-3167
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3167
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.19.0
>            Reporter: jin xing
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> In current code of {{EnumerableTableScan}}, methods of equals and hashCode 
> are overridden for matching of {{EnumerableTableScan}}s.
> While after optimizing with the same HEP planner, {{EnumerableTableScan}}s 
> from two plans but with the same digest will the share the same Java object. 
> See 
> [RelOptMaterializations|https://github.com/apache/calcite/blob/adf4cc4dc5cdb9f5e49c85d10f46a2fdcd831ccf/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java#L192].
> I think it's ok to remove the redundant overriding methods in 
> {{EnumerableTableScan}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to