apache / paimon

Apache Paimon is a lake format that enables building a Realtime Lakehouse Architecture with Flink and Spark for both streaming and batch operations.
https://paimon.apache.org/
Apache License 2.0
2.25k stars 897 forks source link

[Bug] When writing a partitioned table for Paimon using Flink SQL and storing the table on HDFS, the partition directory name on HDFS is displayed abnormally. For example, it shows as SCAN_DATE=19415 instead of the correct format of SCAN_DATE=2023-03-01, where SCAN_DATE is of type date. #773

Open yuanoOo opened 1 year ago

yuanoOo commented 1 year ago

Search before asking

Paimon version

paimon-flink-1.15-0.4-20230330.002117-12.jar

Compute Engine

flink1.15.3

Minimal reproduce step

When writing a partitioned table for Paimon using Flink SQL and storing the table on HDFS, the partition directory name on HDFS is displayed abnormally. For example, it shows as SCAN_DATE=19415 instead of the correct format of SCAN_DATE=2023-03-01, where SCAN_DATE is of type date.

What doesn't meet your expectations?

When writing a partitioned table for Paimon using Flink SQL and storing the table on HDFS, the partition directory name on HDFS is displayed abnormally. For example, it shows as SCAN_DATE=19415 instead of the correct format of SCAN_DATE=2023-03-01, where SCAN_DATE is of type date.

Anything else?

No response

Are you willing to submit a PR?

JingsongLi commented 1 year ago

Direct fixes may have compatibility issues, we should be careful.

yuanoOo commented 1 year ago

Direct fixes may have compatibility issues, we should be careful.

I’m trying to fix this bug, can you assign it to me?

My idea is to format the DATE type in the org.apache.paimon.utils.RowDataPartitionComputer#generatePartValues method. For example, converting the int value 19996 of the DATE type into the correct date string 2024-09-30.

dailai commented 5 months ago

I think this issue need to fix. For example, we develop a paimon connector of seatunnel which use java api of paimon also has the same problem.The types in date,time,timestamp all have the same problem.

dailai commented 3 months ago

@JingsongLi Hi, how about this problem?