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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Shang Yuanchun (Jira)
Avi Levi created FLINK-10961:
--------------------------------

             Summary: 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: Kafka Connector
    Affects Versions: 1.6.2
            Reporter: Avi Levi


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.3#76005)