[
https://issues.apache.org/jira/browse/BEAM-12473?focusedWorklogId=611157&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-611157
]
ASF GitHub Bot logged work on BEAM-12473:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jun/21 06:19
Start Date: 15/Jun/21 06:19
Worklog Time Spent: 10m
Work Description: je-ik commented on pull request #14986:
URL: https://github.com/apache/beam/pull/14986#issuecomment-861207857
> LGTM, though I agree we should probably move this to another package.
I marked the class `@Experimental` so that we can move it to different
package, if we find one. I didn't want to create a package for single class ATM.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 611157)
Time Spent: 1.5h (was: 1h 20m)
> ClassCastException when using registerUdaf in Calcite SQL
> ---------------------------------------------------------
>
> Key: BEAM-12473
> URL: https://issues.apache.org/jira/browse/BEAM-12473
> Project: Beam
> Issue Type: Bug
> Components: dsl-sql
> Affects Versions: 2.31.0
> Reporter: Jan Lukavský
> Assignee: Jan Lukavský
> Priority: P2
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> When using {{registerUdaf}} as follows:
> {code:java}
> .registerUdaf(
> "LONGEST_WORD",
> Max.of(
> (Comparator<String> & Serializable)
> (String a, String b) ->
> Integer.compare(a.length(), b.length()))))
> {code}
> results in following exception:
> {noformat}
> Caused by: java.lang.ClassCastException: class
> sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to
> class java.lang.Class
> (sun.reflect.generics.reflectiveObjects.TypeVariableImpl and java.lang.Class
> are in module java.base of loader 'bootstrap')
> at
> org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils.sqlTypeWithAutoCast(CalciteUtils.java:327)
> at
> org.apache.beam.sdk.extensions.sql.impl.UdafImpl$1.getType(UdafImpl.java:73)
> at
> org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.prepare.CalciteCatalogReader.toOp(CalciteCatalogReader.java:315)
> at
> org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.prepare.CalciteCatalogReader.toOp(CalciteCatalogReader.java:302)
> at
> org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.prepare.CalciteCatalogReader.lambda$lookupOperatorOverloads$3(CalciteCatalogReader.java:271)
> at
> java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
> at
> java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
> {noformat}
> If this way of registering UDAF is not supported, it should throw a more
> user-friendly exception.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)