Skip to content

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

Closed

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

Activity

  1. changed the title [-]TO_DATE Gandiva function retruns wrong date for pattern YYYY-MM[/-] [+]TO_DATE Gandiva function returns wrong date for pattern YYYY-MM[/+] on Sep 7, 2023
  2. changed the title [-]TO_DATE Gandiva function returns wrong date for pattern YYYY-MM[/-] [+][C++][Gandiva] TO_DATE Gandiva function returns wrong date for pattern YYYY-MM[/+] on Sep 8, 2023
  3. changed the title [-][C++][Gandiva] TO_DATE Gandiva function returns wrong date for pattern YYYY-MM[/-] [+][C++][Gandiva] TO_DATE unction returns wrong date for pattern YYYY-MM[/+] on Sep 8, 2023
  4. added a commit that references this issue on Sep 8, 2023
  5. added this to the 14.0.0 milestone on Sep 8, 2023
  6. added 2 commits that reference this issue on Sep 8, 2023
  7. added a commit that references this issue on Sep 26, 2023
  8. added a commit that references this issue on Oct 11, 2023
  9. added a commit that references this issue on Oct 29, 2023
  10. added a commit that references this issue on Nov 2, 2023
  11. added a commit that references this issue on Nov 13, 2023
  12. added a commit that references this issue on Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions