You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Avi Levi (JIRA)" <ji...@apache.org> on 2019/07/15 13:22:00 UTC

[jira] [Commented] (FLINK-10961) RuntimeException: Could not extract key when using closure

    [ https://issues.apache.org/jira/browse/FLINK-10961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16885222#comment-16885222 ] 

Avi Levi commented on FLINK-10961:
----------------------------------

[~yanghua] , actually, now I cannot reproduce it either (it might be an old flink version) anyway this issue can be closed . thanks !!!

 

> RuntimeException: Could not extract key when using closure 
> -----------------------------------------------------------
>
>                 Key: FLINK-10961
>                 URL: https://issues.apache.org/jira/browse/FLINK-10961
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Scala, Runtime / State Backends
>    Affects Versions: 1.7.0
>            Reporter: Avi Levi
>            Priority: Major
>
> I am getting this exception when I tried to extract the key using external value e.g 
> {code:java}
> val partitionFactor = 10
> val domainsSrc = env
> .addSource(kafkaConsumer)
> .keyBy(_.id.hashCode % partitionFactor
> .map(...) 
> {code}
> I am getting this exception 
> {code:java}
> java.lang.RuntimeException: Could not extract key from Foo("some-uuid","text",1540348398,1)
> ....
> Caused by: java.lang.ArithmeticException: / by zero
> {code}
> however when I simply use it like 
> {code:java}
> val domainsSrc = env
> .addSource(kafkaConsumer)
> .keyBy(_.id.hashCode % 10
> .map(...) 
> {code}
> it works fine 



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)