GH-44054: [C++] Implement PostgreSQL dedicated date extracting functions
Rationale for this change
Described in https://github.com/apache/arrow/issues/44054.
What changes are included in this PR?
Implement three functions to extract PG's DATA/TIMESTAMP data type. They use a common class named year_month_day_pg which is similar to the existing class year_month_day, except adding days alignment with epoch '2000-01-01'.
Are these changes tested?
New test case has been added.
Are there any user-facing changes?
Yes. Add new functions in temporal component extraction for processing PG's DATA/TIMESTAMP data type,
the function names are pg_year, pg_month, pg_day, pg_week corresponding to year, month, day, week respectively.
Thanks for opening a pull request!
If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.
Then could you also rename the pull request title in the following format?
GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
In the case of PARQUET issues on JIRA the title also supports:
PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
See also:
@ZhangHuiGui would you mind take a look?
Could you fix CI failures? You can check CI results on your fork too: https://github.com/marsno1/arrow/actions