Description
Suppose, we have following query where UDAF error_aggregator returns Map<String,String>
select error_name, error_aggregator(error_types) as error_types_aggregated " +"from PCOLLECTION group by error_name").registerUdaf("error_aggregator", new ErrorTypeAggregator()
class ErrorTypeAggregator extends CombineFn<String, String, HashMap<String,String>> { ... }
It fails with following exception.
Exception in thread "main" org.apache.beam.sdk.extensions.sql.impl.ParseException: Unable to parse query select error_name, error_aggregator(error_types) as error_types_aggregated from PCOLLECTION group by error_nameException in thread "main" org.apache.beam.sdk.extensions.sql.impl.ParseException: Unable to parse query select error_name, error_aggregator(error_types) as error_types_aggregated from PCOLLECTION group by error_name at org.apache.beam.sdk.extensions.sql.impl.CalciteQueryPlanner.convertToBeamRel(CalciteQueryPlanner.java:199) at org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv.parseQuery(BeamSqlEnv.java:114) at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:140) at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:86) at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:547) at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:481) at org.apache.beam.sdk.values.PCollection.apply(PCollection.java:357) at com.my.company.UdafMapOutput.main(UdafMapOutput.java:70)Caused by: org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.tools.ValidationException: java.lang.ClassCastException: org.apache.beam.vendor.guava.v26_0_jre.com.google.common.reflect.Types$ParameterizedTypeImpl cannot be cast to java.lang.Class at org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.prepare.PlannerImpl.validate(PlannerImpl.java:217) at org.apache.beam.sdk.extensions.sql.impl.CalciteQueryPlanner.convertToBeamRel(CalciteQueryPlanner.java:168) ... 7 more
Attachments
Issue Links
- links to