You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chan (JIRA)" <ji...@apache.org> on 2019/07/11 04:28:00 UTC

[jira] [Issue Comment Deleted] (CALCITE-3188) IndexOutOfBoundsException in ProjectFilterTransposeRule when executing SELECT COUNT(*)

     [ https://issues.apache.org/jira/browse/CALCITE-3188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Danny Chan updated CALCITE-3188:
--------------------------------
    Comment: was deleted

(was: [~zabetak], thanks for reporting this, i tried but don't know how to make a rel of struct row type but with empty field list, cause this bug has been fixed, i would merge the PR soon if the tests are all passed.)

> IndexOutOfBoundsException in ProjectFilterTransposeRule when executing SELECT COUNT(*)
> --------------------------------------------------------------------------------------
>
>                 Key: CALCITE-3188
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3188
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.21.0
>            Reporter: Stamatis Zampetakis
>            Assignee: Danny Chan
>            Priority: Blocker
>              Labels: pull-request-available
>             Fix For: 1.21.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The exception is raised by many tests in {{DruidAdapterIT}}. 
> What they all have in common is a query of the following form:
> {code:java}
> SELECT COUNT(*) FROM ...
> {code}
> where the query projects only a single column. 
> The stacktrace for {{DruidAdapterIT#testExpressionsFilterWithExtract}} is the following.
> {noformat}
> Caused by: java.lang.RuntimeException: Error while applying rule DruidProjectFilterTransposeRule, args [rel#226:LogicalProject.NONE.[](input=RelSubset#50), rel#83:BindableFilter.BINDABLE.[](input=RelSubset#18,condition==(CAST(+(/(-(EXTRACT(FLAG(MONTH), $0), 1), 3), 1)):INTEGER NOT NULL, 1)), rel#1:DruidQuery.BINDABLE.[](table=[foodmart, foodmart],intervals=[1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z])]
> 	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:235)
> 	at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:631)
> 	at org.apache.calcite.tools.Programs.lambda$standard$3(Programs.java:283)
> 	at org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:343)
> 	at org.apache.calcite.prepare.Prepare.optimize(Prepare.java:189)
> 	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:320)
> 	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:231)
> 	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:637)
> 	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:501)
> 	at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:471)
> 	at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:229)
> 	at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:550)
> 	at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675)
> 	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
> 	... 28 more
> Caused by: java.lang.IndexOutOfBoundsException: index (0) must be less than size (0)
> 	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:310)
> 	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:293)
> 	at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:67)
> 	at org.apache.calcite.rel.rules.ProjectFilterTransposeRule.onMatch(ProjectFilterTransposeRule.java:102)
> 	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:208)
> 	... 41 more
> {noformat}
> It is regression that must be solved before the release.



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