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

daimin edited comment on CALCITE-3447 at 10/25/19 3:28 PM:
-----------------------------------------------------------

[~yanlin-Lynn] Your doubt makes sense. In the test case, when I use 
{color:#ffab00}HepPlanner{color} beforehand to canonicalize both query and 
view, it works well. And the reason why it works is that they refer to a common 
{color:#ffab00}TableScan{color} object, which bypassed this bug. So it's fine 
for us to directly use {color:#ffab00}RelOptMaterializations{color} rather than 
use {color:#ffab00}MaterializedViewSubstitutionVisitor{color} or 
{color:#ffab00}SubstitutionVisitor. {color}I am still on checking why 
{color:#ffab00}HepPlanner{color} will make query and view share a common 
{color:#ffab00}TableScan{color} object, it's weird.


was (Author: daimin):
[~yanlin-Lynn] Your doubt makes sense. In the test case, when I use 
{color:#ffab00}HepPlanner{color} beforehand to canonicalize both query and 
view, it works well. And the reason why it works is that they refer to a common 
{color:#ffab00}TableScan{color} object, which bypassed this bug. So it's fine 
for us to directly use {color:#ffab00}RelOptMaterializations{color} rather than 
use {color:#ffab00}MaterializedViewSubstitutionVisitor{color} or 
{color:#ffab00}SubstitutionVisitor. {color}I am still on checking why 
{color:#ffab00}HepPlanner{color} will make query and view share a common 
{color:#ffab00}TableScan{color} object.

> Fix equivalents in method SubstitutionVisitor#go
> ------------------------------------------------
>
>                 Key: CALCITE-3447
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3447
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: daimin
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Code segment here depends on `hashcode` and `equals` methods of class 
> `MutableRel`:
> [https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java#L492-L502]
>  
> However the implementations of class `MutableScan` delegates to class 
> `TableScan`, which directly relies on implementations of class `Object`. This 
> leads to a situation that two `MutableScan` on the exactly same table will 
> not be considered as equivalent.



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

Reply via email to