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

Julian Hyde commented on CALCITE-4350:
--------------------------------------

Yes, good catch. I intended to make {{reverse()}} non-lossy when I refactored 
it in 
[1ba5c35|https://github.com/apache/calcite/commit/1ba5c3559eb116af11c10d45907faefb5755f546]
 but I forgot. All calls to {{reverse()}} are currently followed by a call to 
{{lax()}} so this is a safe change to make. Let's make it soon.

> The reverse operation of collation direction is overly relaxed
> --------------------------------------------------------------
>
>                 Key: CALCITE-4350
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4350
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Liya Fan
>            Assignee: Liya Fan
>            Priority: Major
>
> For the current implementation, {{RelFieldCollation#Direction#reverse}} 
> returns \{{DESCENDING}} for \{{STRICTLY_ASCENDING}}, and returns 
> \{{ASCENDING}} for {{STRICTLY_DESCENDING}}.
> This is overly relaxed. In a strict manner, it should return 
> \{{STRICTLY_DESCENDING}} for \{{STRICTLY_ASCENDING}}, and vice versa. 
> If the user needs to get the relaxed reverse direction, they may call 
> \{{collation.getDirection().reverse().lax();}}, as in many places of our code 
> base. 
> Do you agree?



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

Reply via email to