From 2ed07704cd5cc50e0cd373f4736e9c8e76a1731d Mon Sep 17 00:00:00 2001 From: David Li Date: Fri, 13 Aug 2021 13:31:20 -0400 Subject: [PATCH 1/2] ARROW-13549: [C++] Add date/time extraction functions --- .../compute/kernels/scalar_cast_temporal.cc | 220 ++++++++--- .../arrow/compute/kernels/scalar_cast_test.cc | 346 +++++++++++++++--- .../arrow/compute/kernels/scalar_temporal.cc | 176 +-------- .../arrow/compute/kernels/temporal_internal.h | 214 +++++++++++ docs/source/python/api/compute.rst | 23 ++ python/pyarrow/tests/test_pandas.py | 25 +- 6 files changed, 730 insertions(+), 274 deletions(-) create mode 100644 cpp/src/arrow/compute/kernels/temporal_internal.h diff --git a/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc b/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc index 1a58fce7c74..0fe537ebbaf 100644 --- a/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc +++ b/cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc @@ -22,6 +22,7 @@ #include "arrow/array/builder_time.h" #include "arrow/compute/kernels/common.h" #include "arrow/compute/kernels/scalar_cast_internal.h" +#include "arrow/compute/kernels/temporal_internal.h" #include "arrow/util/bitmap_reader.h" #include "arrow/util/time.h" #include "arrow/util/value_parsing.h" @@ -117,6 +118,28 @@ Status ShiftTime(KernelContext* ctx, const util::DivideOrMultiply factor_op, return Status::OK(); } +template