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 2016/02/21 09:28:18 UTC

[jira] [Resolved] (CALCITE-1097) Exception when executing query with too many aggregation columns

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

Julian Hyde resolved CALCITE-1097.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.7.0

Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/5fdc866b. [~chenzhifa@mininglamp.com], Thanks for the PR! I agree with you diagnosis of the cause of the bug, and your fix, and I appreciate the detailed test case. I refactored your test case a little.

> Exception when executing query with too  many aggregation columns
> -----------------------------------------------------------------
>
>                 Key: CALCITE-1097
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1097
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.7.0
>            Reporter: chenzhifa
>            Assignee: Julian Hyde
>             Fix For: 1.7.0
>
>
> When executing a query like the following:
> select s."cust_id", sum(s."prod_id"), sum(s."prod_id_1"), ......, sum(s."prod_id_194"), sum(s."prod_id_195"), sum(s."prod_id_196"), sum(s."prod_id_197"), sum(s."prod_id_198"), sum(s."prod_id_199")
> from "foodmart"."table" as s group by s."cust_id"
> Calcite reports exception as followed:
> Exception in thread "main" java.sql.SQLException: Error while executing SQL
> Error while compiling generated Java code:
> public static class Record200_0 implements java.io.Serializable {
> .....
> Caused by: org.codehaus.janino.JaninoRuntimeException: Baz$2.apply(): Operand stack overflow at offset 1195
> 	at org.codehaus.janino.CodeContext.flowAnalysis(CodeContext.java:490)
> Tracking down the error in EnumerableAggregate, I found that this is because Calcite generates a class with a constructor which has as many parameters as the aggregated fields, and the auto-generated java code causes  error while being compiled.
> There is not a certain number of constructor number, since it seems the longest length of constructor parameter also relates to the java type of the parameters.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)