You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by xiaobo <gu...@qq.com.INVALID> on 2022/02/12 01:57:07 UTC

Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]) with ReflectiveSchema

Simple count sql against ReflectiveSchema failed with :


Error while executing SQL "select count(a.PA01AI01) from p.PRH_PA01 as a
": Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]): rowcount = 10.0, cumulative cost = {111.25 rows, 101.0 cpu, 0.0 io}, id = 37
  EnumerableTableScan(table=[[p, PRH_PA01]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 26

    at com.xsmartware.javatest.pbc2p.CalciteBaseVarGenerator.generateVariable(CalciteBaseVarGenerator.java:61)
    at com.xsmartware.javatest.pbc2p.PBC2PTestRunner.test1(PBC2PTestRunner.java:68)
    at com.xsmartware.javatest.pbc2p.PBC2PTestRunner.run(PBC2PTestRunner.java:54)
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:758)
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:748)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:309)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
    at com.xsmartware.javatest.JavaTestApplication.main(JavaTestApplication.java:9)
Caused by: java.sql.SQLException: Error while executing SQL "select count(a.PA01AI01) from p.PRH_PA01 as a
": Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]): rowcount = 10.0, cumulative cost = {111.25 rows, 101.0 cpu, 0.0 io}, id = 37
  EnumerableTableScan(table=[[p, PRH_PA01]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 26

    at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
    at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
    at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:163)
    at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:227)
    at com.xsmartware.common.util.SQLUtil.exeGetLong(SQLUtil.java:42)
    at com.xsmartware.javatest.pbc2p.CalciteBaseVarGenerator.generateVariable(CalciteBaseVarGenerator.java:39)
    ... 8 more
Caused by: java.lang.IllegalStateException: Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]): rowcount = 10.0, cumulative cost = {111.25 rows, 101.0 cpu, 0.0 io}, id = 37
  EnumerableTableScan(table=[[p, PRH_PA01]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 26

    at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:114)
    at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:114)
    at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1130)
    at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:324)
    at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:220)
    at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:647)
    at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:513)
    at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:483)
    at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:249)
    at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623)
    at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:674)
    at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
    ... 11 more
    Suppressed: java.lang.NullPointerException: relFieldType.getComponentType() for JavaType(interface java.util.List)
        at java.base/java.util.Objects.requireNonNull(Objects.java:347)
        at org.apache.calcite.adapter.enumerable.EnumerableTableScan.fieldExpression(EnumerableTableScan.java:269)
        at org.apache.calcite.adapter.enumerable.EnumerableTableScan.toRows(EnumerableTableScan.java:252)
        at org.apache.calcite.adapter.enumerable.EnumerableTableScan.getExpression(EnumerableTableScan.java:209)
        at org.apache.calcite.adapter.enumerable.EnumerableTableScan.implement(EnumerableTableScan.java:340)
        at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.visitChild(EnumerableRelImplementor.java:104)
        at org.apache.calcite.adapter.enumerable.EnumerableAggregate.implement(EnumerableAggregate.java:105)
        at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:111)
        ... 22 more

Re: Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]) with ReflectiveSchema

Posted by xiaobo <gu...@qq.com.INVALID>.
We come to the conclusion that fileds for tables and columns of the target class must be public, and those not for tables and columns must not be public, are we right?




------------------ Original ------------------
From:  "xiaobo ";<gu...@qq.com>;
Send time: Saturday, Feb 12, 2022 9:57 AM
To: "dev"<de...@calcite.apache.org>; 

Subject:  Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]) with ReflectiveSchema



Simple count sql against ReflectiveSchema failed with :


Error while executing SQL "select count(a.PA01AI01) from p.PRH_PA01 as a
": Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]): rowcount = 10.0, cumulative cost = {111.25 rows, 101.0 cpu, 0.0 io}, id = 37
 EnumerableTableScan(table=[[p, PRH_PA01]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 26

 at com.xsmartware.javatest.pbc2p.CalciteBaseVarGenerator.generateVariable(CalciteBaseVarGenerator.java:61)
 at com.xsmartware.javatest.pbc2p.PBC2PTestRunner.test1(PBC2PTestRunner.java:68)
 at com.xsmartware.javatest.pbc2p.PBC2PTestRunner.run(PBC2PTestRunner.java:54)
 at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:758)
 at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:748)
 at org.springframework.boot.SpringApplication.run(SpringApplication.java:309)
 at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
 at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
 at com.xsmartware.javatest.JavaTestApplication.main(JavaTestApplication.java:9)
Caused by: java.sql.SQLException: Error while executing SQL "select count(a.PA01AI01) from p.PRH_PA01 as a
": Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]): rowcount = 10.0, cumulative cost = {111.25 rows, 101.0 cpu, 0.0 io}, id = 37
 EnumerableTableScan(table=[[p, PRH_PA01]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 26

 at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
 at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
 at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:163)
 at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:227)
 at com.xsmartware.common.util.SQLUtil.exeGetLong(SQLUtil.java:42)
 at com.xsmartware.javatest.pbc2p.CalciteBaseVarGenerator.generateVariable(CalciteBaseVarGenerator.java:39)
 ... 8 more
Caused by: java.lang.IllegalStateException: Unable to implement EnumerableAggregate(group=[{}], EXPR$0=[COUNT($0)]): rowcount = 10.0, cumulative cost = {111.25 rows, 101.0 cpu, 0.0 io}, id = 37
 EnumerableTableScan(table=[[p, PRH_PA01]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 26

 at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:114)
 at org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:114)
 at org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1130)
 at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:324)
 at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:220)
 at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:647)
 at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:513)
 at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:483)
 at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:249)
 at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623)
 at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:674)
 at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
 ... 11 more
 Suppressed: java.lang.NullPointerException: relFieldType.getComponentType() for JavaType(interface java.util.List)
 at java.base/java.util.Objects.requireNonNull(Objects.java:347)
 at org.apache.calcite.adapter.enumerable.EnumerableTableScan.fieldExpression(EnumerableTableScan.java:269)
 at org.apache.calcite.adapter.enumerable.EnumerableTableScan.toRows(EnumerableTableScan.java:252)
 at org.apache.calcite.adapter.enumerable.EnumerableTableScan.getExpression(EnumerableTableScan.java:209)
 at org.apache.calcite.adapter.enumerable.EnumerableTableScan.implement(EnumerableTableScan.java:340)
 at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.visitChild(EnumerableRelImplementor.java:104)
 at org.apache.calcite.adapter.enumerable.EnumerableAggregate.implement(EnumerableAggregate.java:105)
 at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:111)
 ... 22 more