While running this query
SELECT COUNTRY_REGION, SUM(CUST_ID) OVER (PARTITION BY COUNTRY_REGION) FROM
SALES.COUNTRIES LEFT JOIN SALES.CUSTOMERS ON CUSTOMERS.COUNTRY_ID =
COUNTRIES.COUNTRY_ID
The following error is thrown
java.lang.AssertionError
at
org.apache.calcite.rel.metadata.RelMdDistribution.calc(RelMdDistribution.java:137)
at
org.apache.calcite.rel.logical.LogicalCalc$1.get(LogicalCalc.java:106)
at
org.apache.calcite.rel.logical.LogicalCalc$1.get(LogicalCalc.java:104)
at org.apache.calcite.plan.RelTraitSet.replaceIf(RelTraitSet.java:249)
at
org.apache.calcite.rel.logical.LogicalCalc.create(LogicalCalc.java:103)
at
org.apache.calcite.rel.rules.ProjectToWindowRule$ProjectToLogicalProjectAndWindowRule.onMatch(ProjectToWindowRule.java:177)
at
org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:212)
at
org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:650)
at org.apache.calcite.tools.Programs$5.run(Programs.java:326)
at
org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:387)
at org.apache.calcite.prepare.Prepare.optimize(Prepare.java:188)
at
org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.prepare_(CalcitePrepareImpl.java:1151)
at
org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.prepareRel(CalcitePrepareImpl.java:1108)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:802)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:640)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:610)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:221)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.prepareStatement_(CalciteConnectionImpl.java:203)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.access$100(CalciteConnectionImpl.java:89)
at
org.apache.calcite.jdbc.CalciteConnectionImpl$1.prepare(CalciteConnectionImpl.java:168)
at org.apache.calcite.tools.RelRunners.run(RelRunners.java:34)
(I removed the rest of the stacktrace)
This is due to a missing implementation of a method. This is the statement
throwing the error
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistribution.java#L137
Would someone please explain what is expected to be done by this method ?
Is it possible to implement the method the same way other similar methods
are ? Which is to call return *mq.distribution(input);* ? I did exactly
that, while debugging and it returned a "single" distribution. This sounds
like a valid default. But is it ?
Also I found that
*org.apache.calcite.rel.metadata.BuiltInMetadata.Distribution.Handler*
implementations are generated classes. Why are these implementation classes
generated and created as other classes are ?
Thanks,
Gelbana