[jira] [Updated] (ARROW-13549) [C++] Implement timestamp to date/time cast that extracts value

2021-09-09 Thread David Li (Jira)


 [ 
https://issues.apache.org/jira/browse/ARROW-13549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Li updated ARROW-13549:
-
Description: 
Change casting from timestamp to date/time to extract the value, instead of 
just truncating as we currently do (which rounds, giving incorrect answers, in 
some cases). This should also be a safe cast by default (unless you want to do 
something like cast from timestamp[ns] to time32[s] which may overflow).

This should behave like Postgres DATE/CAST(... as TIME), or Pandas 
Timestamp.date/Timestamp.time.

  was:
Add a kernel that can extract just the date or the time from a timestamp.

This should behave like Postgres DATE/CAST(... as TIME), or Pandas 
Timestamp.date/Timestamp.time.

Extracting the date appears to be doable with an unsafe cast, but it might be 
more convenient to have an explicit kernel (and an unsafe cast, at least in the 
Python bindings, disables all checks, not just the check we care about).


> [C++] Implement timestamp to date/time cast that extracts value
> ---
>
> Key: ARROW-13549
> URL: https://issues.apache.org/jira/browse/ARROW-13549
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: David Li
>Assignee: David Li
>Priority: Major
>  Labels: kernel, pull-request-available
> Fix For: 6.0.0
>
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> Change casting from timestamp to date/time to extract the value, instead of 
> just truncating as we currently do (which rounds, giving incorrect answers, 
> in some cases). This should also be a safe cast by default (unless you want 
> to do something like cast from timestamp[ns] to time32[s] which may overflow).
> This should behave like Postgres DATE/CAST(... as TIME), or Pandas 
> Timestamp.date/Timestamp.time.



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


[jira] [Updated] (ARROW-13549) [C++] Implement timestamp to date/time cast that extracts value

2021-09-09 Thread David Li (Jira)


 [ 
https://issues.apache.org/jira/browse/ARROW-13549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Li updated ARROW-13549:
-
Summary: [C++] Implement timestamp to date/time cast that extracts value  
(was: [C++] Implement kernel to extract date/time from timestamp)

> [C++] Implement timestamp to date/time cast that extracts value
> ---
>
> Key: ARROW-13549
> URL: https://issues.apache.org/jira/browse/ARROW-13549
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: C++
>Reporter: David Li
>Assignee: David Li
>Priority: Major
>  Labels: kernel, pull-request-available
> Fix For: 6.0.0
>
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> Add a kernel that can extract just the date or the time from a timestamp.
> This should behave like Postgres DATE/CAST(... as TIME), or Pandas 
> Timestamp.date/Timestamp.time.
> Extracting the date appears to be doable with an unsafe cast, but it might be 
> more convenient to have an explicit kernel (and an unsafe cast, at least in 
> the Python bindings, disables all checks, not just the check we care about).



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