Skip to content

[C++][Gandiva] TO_DATE unction returns wrong date for pattern YYYY-MM #37608

@DenisTarasyuk

Description

@DenisTarasyuk

Describe the bug, including details regarding any error messages, version, and platform.

When function TO_DATE is called with pattern 'YYYY-MM' it will return date which has -1 day offset to expected. For example to_date('2022-11', 'YYYY-MM') will return 1667174400000 which is 2022-10-31. Problem is caused by strptime returning 0 in result.tm_mday if day is not part of format. This will cause result to be -1 day from expected.

Component(s)

C++, C++ - Gandiva

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions