From a47b78ad5e9f9d20798b61d599cb33570536d4db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Percy=20Camilo=20Trive=C3=B1o=20Aucahuasi?= Date: Tue, 7 Sep 2021 11:49:29 -0500 Subject: [PATCH] Fix ARROW-13138: Support date32/64 for temporal component extraction functions Reuse most of the iso_calendar algorithm for different types cleaning & minor changes fix and add R tests for year, month, etc functions on date types update cpp docs for temporal compute functions c++ format format all fix windows build fix TestNonexistentTimezone test and clang errors --- .../arrow/compute/kernels/scalar_temporal.cc | 272 ++++++++++++------ .../compute/kernels/scalar_temporal_test.cc | 84 ++++-- docs/source/cpp/compute.rst | 22 +- r/tests/testthat/test-dplyr-lubridate.R | 96 ++++++- 4 files changed, 348 insertions(+), 126 deletions(-) diff --git a/cpp/src/arrow/compute/kernels/scalar_temporal.cc b/cpp/src/arrow/compute/kernels/scalar_temporal.cc index d70411f8338..b60e4ef71f0 100644 --- a/cpp/src/arrow/compute/kernels/scalar_temporal.cc +++ b/cpp/src/arrow/compute/kernels/scalar_temporal.cc @@ -122,13 +122,14 @@ struct ZonedLocalizer { // // Executor class for temporal component extractors, i.e. scalar kernels -// with the signature Timestamp -> +// with the signature temporal type -> // // The `Op` parameter is templated on the Duration (which depends on the timestamp // unit) and a Localizer class (depending on whether the timestamp has a // timezone defined). // -template