ricky2129 opened a new issue, #12954: URL: https://github.com/apache/seatunnel/issues/12954
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues. ### What happened The Parquet file sink keeps only milliseconds of every `TIMESTAMP` value. A MySQL `DATETIME(6)` value `2026-04-27 20:50:29.006733` is written as `2026-04-27 20:50:29.006`. The source side keeps the microseconds: MySQL-CDC (`MicroTimestamp`) and JDBC (`java.sql.Timestamp#getNanos`) both hand the sink a `LocalDateTime` with them, so the loss is in `ParquetWriteStrategy` only. - INT64 path: the column is declared `INT64 TIMESTAMP_MILLIS` and the value is `toEpochMilli()`. - INT96 path (`parquet_avro_write_timestamp_as_int96 = true`): the nanos of the day are rebuilt from `Calendar` fields, the last one being `Calendar.MILLISECOND`, so it truncates to milliseconds as well. - Reading back: `ParquetReadStrategy` maps INT64 to `TIMESTAMP` only for `TIMESTAMP_MILLIS` (a `TIMESTAMP_MICROS` column, as written by Spark, is read as `BIGINT`), and the INT96 path drops everything below milliseconds. Reproduced end to end on 2.3.12: MySQL 8.4 → MySQL-CDC (snapshot and binlog) and Jdbc source → LocalFile parquet, diffing every cell against MySQL. `DATETIME(4..6)` and `TIMESTAMP(4..6)` lose digits in every path; precision 0..3 is unaffected. `dev` has the same writer and reader code. ### SeaTunnel Version 2.3.12, dev (4dcfa28ccc) ### SeaTunnel Config ```conf env { job.mode = "BATCH" } source { Jdbc { url = "jdbc:mysql://host:3306/db", driver = "com.mysql.cj.jdbc.Driver", user = "...", password = "...", table_path = "db.t" } } sink { LocalFile { path = "/tmp/out", file_format_type = "parquet" } } ``` with `CREATE TABLE t (id INT PRIMARY KEY, dt6 DATETIME(6)); INSERT INTO t VALUES (1, '2026-04-27 20:50:29.006733');` ### Running Command ```shell ./bin/seatunnel.sh -c job.conf ``` ### Error Exception ```log No error. pyarrow on the output file: dt6: timestamp[ms, tz=UTC] = 2026-04-27 20:50:29.006 ``` ### Zeta or Flink or Spark Version Zeta ### Java or Scala Version Java 8 ### Screenshots _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
