I believe I found the issue:
new RowTypeInfo(Types.PRIMITIVE_ARRAY(Types.LONG()))
vs
new RowTypeInfo(createTypeInformation[Array[Long]])
I didn't quite understand at the time whose type information I was meant to
supply, now I do.

However, I think my question still stands. Is there a way for this
information to be more directly encoded by scala api's types so this kind
of confusion never happens?
E.g. If my UDF is returning an Array of Longs then for what reason should I
ever need to then specify that directly from within getResultType?

On Wed, Oct 14, 2020 at 4:06 PM Jeff Zhang <[email protected]> wrote:

> Could you share your code to reproduce it ?
>
> Rex Fenley <[email protected]> 于2020年10月15日周四 上午5:54写道:
>
>> Hello,
>>
>> I've been playing with UDFs using the Scala API and have repeatedly run
>> into issues such as this:
>> ```
>> flink-taskmanager_1    | java.lang.ClassCastException:
>> scala.collection.immutable.Set$EmptySet$ cannot be cast to [J
>> ```
>> Is there something that can be done on Flink's end, either to catch these
>> errors in type checking or to cast them in a sane manner during runtime?
>>
>> Thanks!
>>
>> --
>>
>> Rex Fenley  |  Software Engineer - Mobile and Backend
>>
>>
>> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
>>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
>> <https://www.facebook.com/remindhq>
>>
>
>
> --
> Best Regards
>
> Jeff Zhang
>


-- 

Rex Fenley  |  Software Engineer - Mobile and Backend


Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>

Reply via email to