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

zhen wang edited comment on CALCITE-1862 at 3/13/18 1:42 PM:
-------------------------------------------------------------

removing either  one of the two rules:

{code}
          ProjectFilterTransposeRule.INSTANCE, // removes this generates some 
new issue but no infinitely deep REL problem
          FilterProjectTransposeRule.INSTANCE, // removes this solves this 
problem. 
{code}

so I guess these two optimization rules are fighting against each other in this 
issue. 




was (Author: zhenw):
removing either  one of the two rules:

          ProjectFilterTransposeRule.INSTANCE, // removes this generates some 
new issue but no infinitely deep REL problem
          FilterProjectTransposeRule.INSTANCE, // removes this solves this 
problem. 


so I guess these two optimization rules are fighting against each other in this 
issue. 



> StackOverflowException in RelMdUtil.estimateFilteredRows
> --------------------------------------------------------
>
>                 Key: CALCITE-1862
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1862
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>
> The query
> {code}select *
> from (
>   select *
>   from (
>     select cast(null as integer) as d
>     from "scott".emp)
>   where d is null and d is null)
> where d is null;{code}
> gives
> {noformat}
> java.lang.StackOverflowError
> >     at 
> > org.apache.calcite.adapter.clone.ArrayTable.getStatistic(ArrayTable.java:76)
> >     at 
> > org.apache.calcite.prepare.RelOptTableImpl.getRowCount(RelOptTableImpl.java:224)
> >     at 
> > org.apache.calcite.rel.core.TableScan.estimateRowCount(TableScan.java:75)
> >     at 
> > org.apache.calcite.rel.metadata.RelMdRowCount.getRowCount(RelMdRowCount.java:206)
> >     at GeneratedMetadataHandler_RowCount.getRowCount_$(Unknown Source)
> >     at GeneratedMetadataHandler_RowCount.getRowCount(Unknown Source)
> >     at 
> > org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:236)
> >     at 
> > org.apache.calcite.rel.metadata.RelMdRowCount.getRowCount(RelMdRowCount.java:71)
> >     at GeneratedMetadataHandler_RowCount.getRowCount_$(Unknown Source)
> >     at GeneratedMetadataHandler_RowCount.getRowCount(Unknown Source)
> >     at 
> > org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:236)
> >     at 
> > org.apache.calcite.rel.metadata.RelMdUtil.estimateFilteredRows(RelMdUtil.java:718)
> >     at 
> > org.apache.calcite.rel.metadata.RelMdRowCount.getRowCount(RelMdRowCount.java:123)
> >     at GeneratedMetadataHandler_RowCount.getRowCount_$(Unknown Source)
> >     at GeneratedMetadataHandler_RowCount.getRowCount(Unknown Source)
> >     at 
> > org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:236)
> >     at 
> > org.apache.calcite.rel.metadata.RelMdRowCount.getRowCount(RelMdRowCount.java:71)
> >     at GeneratedMetadataHandler_RowCount.getRowCount_$(Unknown Source)
> >     at GeneratedMetadataHandler_RowCount.getRowCount(Unknown Source)
> >     at 
> > org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:236)
> >     at 
> > org.apache.calcite.rel.metadata.RelMdUtil.estimateFilteredRows(RelMdUtil.java:718){noformat}
> For a test case, add the query to misc.iq and run QuidemTest.



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

Reply via email to