You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Taras Kuzyo (Jira)" <ji...@apache.org> on 2020/10/30 13:37:00 UTC

[jira] [Created] (ARROW-10431) Cast timestamp to time32/time64

Taras Kuzyo created ARROW-10431:
-----------------------------------

             Summary: Cast timestamp to time32/time64
                 Key: ARROW-10431
                 URL: https://issues.apache.org/jira/browse/ARROW-10431
             Project: Apache Arrow
          Issue Type: Wish
          Components: C++, Python
    Affects Versions: 2.0.0
            Reporter: Taras Kuzyo


 It would be great to have the ability to cast a timestamp to a time type.

I am not sure about the amount of coding involved but conceptually it looks relatively simple.  
{code:java}
>>> pc.cast(pc.strptime('13:13:30', format='%H:%M:%S', unit='s'), pa.time32('s'))
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/local/lib/python3.6/dist-packages/pyarrow/compute.py", line 243, in cast
 return call_function("cast", [arr], options)
 File "pyarrow/_compute.pyx", line 446, in pyarrow._compute.call_function
 File "pyarrow/_compute.pyx", line 275, in pyarrow._compute.Function.call
 File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
 File "pyarrow/error.pxi", line 105, in pyarrow.lib.check_status
 pyarrow.lib.ArrowNotImplementedError: Unsupported cast from timestamp[s] to time32 using function cast_time32{code}
 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)