linkedin / linkedin/databus

Mysql example exception: Bad key type: java.math.BigInteger

Open
#96 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.7k
Forks
736
PR merge metrics
No merged PRs in 30d

Description

Hi,
when I execute the mysql example following wiki "Databus for MySQL", I met an exception below:

com.linkedin.databus.core.DatabusRuntimeException: com.linkedin.databus2.core.DatabusException: com.linkedin.databus.core.UnsupportedKeyException: Bad key type: java.math.BigInteger
at com.linkedin.databus2.producers.ORListener.endXtion(ORListener.java:242)
at com.linkedin.databus2.producers.ORListener.run(ORListener.java:761)
Caused by: com.linkedin.databus2.core.DatabusException: com.linkedin.databus.core.UnsupportedKeyException: Bad key type: java.math.BigInteger
at com.linkedin.databus2.producers.OpenReplicatorEventProducer$EventProducerThread.onEndTransaction(OpenReplicatorEventProducer.java:486)
at com.linkedin.databus2.producers.ORListener.endXtion(ORListener.java:238)
... 1 more
Caused by: com.linkedin.databus.core.UnsupportedKeyException: Bad key type: java.math.BigInteger
at com.linkedin.databus.core.DbusEventKey.(DbusEventKey.java:126)
at com.linkedin.databus2.producers.OpenReplicatorAvroEventFactory.createAndAppendEvent(OpenReplicatorAvroEventFactory.java:101)
at com.linkedin.databus2.producers.OpenReplicatorEventProducer$EventProducerThread.addTxnToBuffer(OpenReplicatorEventProducer.java:544)
at com.linkedin.databus2.producers.OpenReplicatorEventProducer$EventProducerThread.onEndTransaction(OpenReplicatorEventProducer.java:480)
... 2 more

And this is the MySQL environment:

siters-MacBook-Pro:distributions shenyuan$ mysql --version --help
mysql Ver 14.14 Distrib 5.6.23, for osx10.8 (x86_64) using EditLine wrapper

I found it is because the bigint type of id column in the table defined in create_person.sql, and this exception is gone after I replace the bigint with int in create_person.sql.

Hope it helps.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with create_person.sql and reproduce the MySQL example using a bigint id, then trace the reported path through DbusEventKey.java:126 and OpenReplicatorAvroEventFactory.java:101. Compare the bigint failure with the int workaround and verify the example completes without the UnsupportedKeyException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.