apache / drill

Apache Drill is a distributed MPP query layer for self describing data
https://drill.apache.org/
Apache License 2.0
1.94k stars 980 forks source link

Incorrect date format pattern in `DateGen` #2958

Open Marcono1234 opened 3 hours ago

Marcono1234 commented 3 hours ago

Describe the bug https://github.com/apache/drill/blob/138563a55141b8844c99f5853894b1e63fcf9582/exec/java-exec/src/main/java/org/apache/drill/exec/store/mock/DateGen.java#L47

To Reproduce

Date date = Date.from(Instant.parse("2024-10-26T22:00:00Z"));
// Bug: Prints "2024-00-301"
new SimpleDateFormat("yyyy-mm-DD").format(date);

Drill version master (138563a55141b8844c99f5853894b1e63fcf9582)

pjfanning commented 3 hours ago

yyyy-MM-dd seems more correct alright - do you want to do a PR?

Marcono1234 commented 3 hours ago

I am not sure if that could break something, in case parts of this project rely on this incorrect format. Or if DateGen is even used at all.

If possible, could you or some of the other maintainers please fix it instead?

(It is not urgent for me though; I am not using the DateGen class, but just stumbled upon this issue in its source code.)