Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to process numeric types #100

Open
mdeyellteika opened this issue Sep 17, 2021 · 0 comments
Open

Unable to process numeric types #100

mdeyellteika opened this issue Sep 17, 2021 · 0 comments

Comments

@mdeyellteika
Copy link

mdeyellteika commented Sep 17, 2021

When trying to process numeric types I receive the following stack trace.

17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 -org.postgresql.util.PSQLException: Bad value for type BigDecimal : 0.05 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at org.postgresql.jdbc.PgResultSet.scaleBigDecimal(PgResultSet.java:2913) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at org.postgresql.jdbc.PgResultSet.getNumeric(PgResultSet.java:2350) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at org.postgresql.jdbc.PgResultSet.getBigDecimal(PgResultSet.java:2314) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at io.aiven.connect.jdbc.dialect.GenericDatabaseDialect.lambda$columnConverterFor$20(GenericDatabaseDialect.java:1181) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at io.aiven.connect.jdbc.source.SchemaMapping$FieldSetter.setField(SchemaMapping.java:161) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at io.aiven.connect.jdbc.source.TimestampIncrementingTableQuerier.extractRecord(TimestampIncrementingTableQuerier.java:197) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at io.aiven.connect.jdbc.source.JdbcSourceTask.poll(JdbcSourceTask.java:326) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at org.apache.kafka.connect.runtime.WorkerSourceTask.poll(WorkerSourceTask.java:291) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:248) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:189) 17 Sep 2021 16:41:02.476tm-staging-selachii-db-kafka-connect-4 - at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:238) 17 Sep 2021 16:41:02.477tm-staging-selachii-db-kafka-connect-4 - at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) 17 Sep 2021 16:41:02.477tm-staging-selachii-db-kafka-connect-4 - at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 17 Sep 2021 16:41:02.477tm-staging-selachii-db-kafka-connect-4 - at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 17 Sep 2021 16:41:02.477tm-staging-selachii-db-kafka-connect-4 - at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

I suspect the issue may be related to the use of getBigDecimal since passing a scale is deprecated and the crash occurs when scaling the decimal.

https://github.com/aiven/aiven-kafka-connect-jdbc/blob/master/src/main/java/io/aiven/connect/jdbc/dialect/GenericDatabaseDialect.java#L1181

https://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#getBigDecimal(int,%20int)

We're running AIven JDBC Source connector version 6.6.0 on Kafka Connect 2.7.1 (Aiven hosted) and are querying Postgres 13.4 (Aiven hosted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant