alibaba / alibaba/DataX

sqlserver 同步到 mysql的 datetime(6)类型数据丢失精度

Open
#1,689 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
17.4k
Forks
5.7k
PR merge metrics
No merged PRs in 30d

Description

image
如图,从 sqlserver 迁移到 mysql,mysql 该字段已经设置为 datetime(6),但精度丢失了。请问该如何处理?

json如下:

"content": [{
"reader": {
"name": "sqlserverreader",
"parameter": {
"username": "",
"password": "",
"connection": [
{
"querySql": [
"select * from dbo.source_tb;"
],
"jdbcUrl": [
"jdbc:sqlserver://1.1.1.1:1433;DatabaseName=source_db"
]
}
]
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"writeMode": "update",
"username": "",
"password": "",
"column": [
"`bind_date`"
],
"connection": [
{
"jdbcUrl": "jdbc:mysql://2.2.2.2:3306/target_db?useUnicode=true&characterEncoding=UTF-8",
"table": [
"target_tb"
]
}

Contributor guide

No contributing guide indexed for this repository

Research direction

The report provides a DataX JSON configuration for sqlserverreader and mysqlwriter and describes precision loss when migrating datetime data to MySQL datetime(6). Start by reproducing the migration with the supplied configuration and trace how the reader and writer handle datetime values. Done means the fractional-second precision is preserved in the MySQL target.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.