You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2017/11/17 01:08:00 UTC

[jira] [Commented] (CALCITE-2057) StackOverflowError when running a JDBC query

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

Julian Hyde commented on CALCITE-2057:
--------------------------------------

This looks similar to CALCITE-1048, CALCITE-794, CALCITE-790. Maybe cycles in the metadata evaluation due to cyclic RelNode graph, or maybe just a very deep call stack.

> StackOverflowError when running a JDBC query
> --------------------------------------------
>
>                 Key: CALCITE-2057
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2057
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.14.0
>            Reporter: Eyal Segal
>            Assignee: Julian Hyde
>            Priority: Minor
>
> I've ran the following code:
> {code:java}
> try (ResultSet rs = statement.executeQuery(
>                 "SELECT p.name, r.views " +
>                     "FROM reports.a as r " +
>                     "INNER JOIN main.b as p ON p.id = CAST(r.p_id AS INT) AND p.id = 196 " +
>                     "WHERE p.id = 196 " +
>                     "AND r.p_id = 196 " +
>                     "AND r.data_timestamp = TIMESTAMP '2017-11-14 00:00:00'  " )) {
> {code}
> And I'm getting the following StackOverflowError:
> {code:java}
> Exception in thread "main" java.lang.StackOverflowError
> 	at com.google.common.collect.ImmutableList.indexOf(ImmutableList.java:339)
> 	at GeneratedMetadataHandler_RowCount.getRowCount_$(Unknown Source)
> 	at GeneratedMetadataHandler_RowCount.getRowCount(Unknown Source)
> 	at org.apache.calcite.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:235)
> 	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:235)
> 	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:235)
> 	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:235)
> 	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)
> ...
> {code}
> It's solved by removing "AND p.id = 196" from the INNER JOIN, but it's still worth fixing.



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