Hello,
Did some more work on this. Follow up question on this:
I am doing a
{cp::call("cast",
{cp::field_ref("time_ns")},
cp::CastOptions::Safe(arrow::timestamp(arrow::TimeUnit::NANO, timezone)))},
And got:
NotImplemented: Unsupported cast from uint64 to timestamp using function
cast_timestamp
Is this the wrong way to convert uint64 to timestamp or is it just not
supported right now?
On Thu, Feb 3, 2022 at 12:29 PM Rok Mihevc <[email protected]> wrote:
> By the way - if you're extracting components to segment time you might
> prefer temporal rounding
>
> https://arrow.apache.org/docs/dev/cpp/compute.html?highlight=floor_temporal#conversions
> .
>
> On Thu, Feb 3, 2022 at 5:19 PM Li Jin <[email protected]> wrote:
> >
> > Gotcha. Thanks for the pointer!
> >
> > On Thu, Feb 3, 2022 at 11:06 AM Rok Mihevc <[email protected]> wrote:
> >
> > > > Gotcha. "Assume timezone" is like "tz_localize" in pandas.
> > >
> > > Indeed!
> > >
> > > > I didn't see any target timezone information being passed in the
> "cast"
> > > > function - how would I do that?
> > >
> > > Just cast with:
> > > auto options = CastOptions::Safe(timestamp(TimeUnit::NANO,
> > > "America/New_York"));
> > > See examples in:
> > >
> > >
> https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/kernels/scalar_cast_test.cc
> > >
>