apache / apache/paimon

[Bug] Convert timestamp_ltz field contents using local time zone

Open
#4,030 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.4k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
396

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.

### Paimon version

0.8

### Compute Engine

flink

### Minimal reproduce step

1. Create a mysql table containing the timestamp type, and specify the time zone for mysql server to be UTC+8
2. Use flink-cdc to import the data of the table into kafka
3. Create a paimon table, which uses a timestamp_ltz type field to store the value of the timestamp type field in mysql
4. If you query the paimon table in UTC+8, you will find that there are still 8 hours missing

### What doesn't meet your expectations?

The content of the timestamp_ltz field retrieved from the Paimon table should be the same as in mysql

### Anything else?

I think the root cause is that we use the utc time zone to read the data from kafka, but use the current time zone to write the data to paimon.

![image](https://github.com/user-attachments/assets/74ca5aa7-040e-49c4-bd5a-9b842f91aa6c)
![image](https://github.com/user-attachments/assets/5acb4486-feec-43ad-9d1f-96f40ed9a03f)

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the minimal reproduction involving MySQL, Flink CDC, Kafka, and a Paimon timestamp_ltz field, comparing results under UTC+8. Trace whether Kafka data is read in UTC and written to Paimon in the current time zone; done means querying the Paimon table returns the same timestamp as MySQL.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kafka, mysql
Domain
data-engineering, databases, stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.