[ https://issues.apache.org/jira/browse/CALCITE-4108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153360#comment-17153360 ]
Roman Churganov edited comment on CALCITE-4108 at 7/8/20, 8:47 AM: ------------------------------------------------------------------- tp.n in Schema is FLOAT, the value returned from table is of type java.lang.Float, o.k is VARCHAR (java.lang.String) seems the problem in generated code: public Record2_0 apply(Record2_0 acc, Object[] in) { final Double inp0_ = (Double) in[0]; if (inp0_ != null) { acc.f1 = true; acc.f0 = org.apache.calcite.runtime.SqlFunctions.greater(acc.f0, inp0_.doubleValue()); } return acc; } was (Author: rrrrrr111): tp.n in Schema is FLOAT, the value returned from table is of type java.lang.Float, o.k is VARCHAR (java.lang.String) > ClassCastException: java.lang.Float cannot be cast to java.lang.Double > ---------------------------------------------------------------------- > > Key: CALCITE-4108 > URL: https://issues.apache.org/jira/browse/CALCITE-4108 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.23.0 > Environment: JDK 1.8 > Reporter: Roman Churganov > Priority: Critical > > running a query like : > {{select tp.o, MAX( tp.n )}} > {{ from tp join o on tp.o = o.k}} > {{ group by tp.o}} > type of tp.n in Schema is FLOAT, value of tp.n returned from table is of type > java.lang.Float, Calcite makes grouping internally and get error > > {{java.lang.ClassCastException: java.lang.Float cannot be cast to > java.lang.Doublejava.lang.ClassCastException: java.lang.Float cannot be cast > to java.lang.Double at Baz$1.apply(Unknown Source) at Baz$1.apply(Unknown > Source) at Baz$1.apply(Unknown Source) at > org.apache.calcite.adapter.enumerable.SequencedAdderAggregateLambdaFactory$AccumulatorAdderSeq.apply(SequencedAdderAggregateLambdaFactory.java:81) > at > org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:806) > at > org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:739) > at > org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:299) > at Baz.bind(Unknown Source)}} > > > > -- This message was sent by Atlassian Jira (v8.3.4#803005)