[ 
https://issues.apache.org/jira/browse/ARROW-14122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17420386#comment-17420386
 ] 

Phillip Cloud commented on ARROW-14122:
---------------------------------------

[~jorgecarleitao] If I understand correctly the antisymmetry relation doesn't 
hold for compound interval values with components that mix {{>= day}} and {{< 
day}} resolution because {{<=}} and {{>=}} operations are not well defined for 
those types, so the evaluating the statement "is a <= b and b <= a?" cannot be 
done without knowledge of the reference point. For example:

{code:sql}
interval '1 day -1 millisecond' 
interval '86399999 milliseconds'
{code}

These two values cannot be distinctly ordered without additional information. 
For example, DST might cause a day's length to be something other than 24 
hours, which would make these two values compare less than, equal to, and 
greater than, depending on what the start and end points of the interval are.

I don't think Arrow intervals except for Month, have a well-defined partial or 
total ordering, nor can they be compared for equality.

I don't think we should special case anything here either. Partial 
functionality like "only month intervals can be compared" or "month intervals 
and intervals whose values don't mix >= day and < day resolution units can be 
compared". I think this will generate a lot of confusion about what operations 
are valid on what values.

[~houqp] I brought up that PR as a point of reference for my claim that I don't 
think there's any interval comparison implementation whose functionality cannot 
be achieved with comparing the output from a set of time-units-between 
functions. That includes hashing needed for grouped aggregations, as well as 
comparison for sorting.

I am -1 on implementing any kind of comparison operations for Arrow interval 
types.

> [C++] interval comparison kernels
> ---------------------------------
>
>                 Key: ARROW-14122
>                 URL: https://issues.apache.org/jira/browse/ARROW-14122
>             Project: Apache Arrow
>          Issue Type: Sub-task
>            Reporter: Phillip Cloud
>            Priority: Major
>              Labels: kernel
>
> Subtask for tracking interval comparison kernels



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

Reply via email to