datavane / datavines

Know your data better!Datavines is Next-gen Data Observability Platform, support metadata manage and data quality.
https://datavane.github.io/datavines-website/
Apache License 2.0
501 stars 155 forks source link

[Bug] [Error Data Storage] Sink error data error when column datatype is 'tinyint(1)' #358

Closed AlexChen68 closed 8 months ago

AlexChen68 commented 8 months ago

Search before asking

What happened

当使用错误数据源存储错误数据时,由于源表中存在一个类型为 tinyint(1) 的字段,在 ErrorDataSinkExecutorsinkErrorData() 查询出来的错误结果列表中,该字段的值为 true,而不是 1,从而导致 sink error data error

截屏2024-02-08 20 37 35 截屏2024-02-08 20 36 21

DataVines Version

1.0.0-SNAPSHOT

DataVines Config

Running Command

本地源码启动,使用 mysql 数据源

Error Exception

[INFO] 2024-02-08 20:34:57.551 [JobExecutionUniqueId=JOB-20240208-client_local_2:[329] - create error data table : CREATE TABLE IF NOT EXISTS column_null_perm_1707395677249 (id BIGINT,parent_id BIGINT,tree_path TEXT,name TEXT,type TINYINT,path TEXT,component TEXT,perm TEXT,visible TINYINT,sort BIGINT,icon TEXT,redirect TEXT,create_time TEXT,update_time TEXT,always_show TINYINT,keep_alive TINYINT)
[ERROR] 2024-02-08 20:36:45.719 [JobExecutionUniqueId=JOB-20240208-client_local_2:[293] - sink error data error :
java.lang.NumberFormatException: For input string: "true"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Byte.parseByte(Byte.java:149)
at java.lang.Byte.parseByte(Byte.java:175)
at io.datavines.engine.local.connector.executor.ErrorDataSinkExecutor.sinkErrorData(ErrorDataSinkExecutor.java:201)
at io.datavines.engine.local.connector.executor.ErrorDataSinkExecutor.execute(ErrorDataSinkExecutor.java:71)
at io.datavines.engine.local.connector.BaseJdbcSink.output(BaseJdbcSink.java:98)
at io.datavines.engine.local.api.LocalExecution.execute(LocalExecution.java:146)
at io.datavines.engine.core.BaseDataVinesBootstrap.parseConfigAndExecute(BaseDataVinesBootstrap.java:79)
at io.datavines.engine.core.BaseDataVinesBootstrap.execute(BaseDataVinesBootstrap.java:43)
at io.datavines.engine.local.executor.LocalEngineExecutor.execute(LocalEngineExecutor.java:44)
at io.datavines.server.dqc.executor.runner.JobRunner.run(JobRunner.java:66)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)

Engine Type

local

Java Version

Java 8

Screenshots

No response

Are you willing to submit PR?

xxzuo commented 8 months ago

考虑在 jdbc 连接 添加一个 tinyInt1isBit=false 再试一下 参考 https://dev.mysql.com/doc/connectors/en/connector-j-reference-type-conversions.html

AlexChen68 commented 8 months ago

在新建数据源的参数中添加确实有效,感谢!