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

Julian Hyde commented on CALCITE-6454:
--------------------------------------

Once arrays are comparable, you should be able to use them in {{ORDER BY}}, 
including with {{DESC}}. Add tests for this.

Likewise {{RANK}} and {{DENSE_RANK}}.

What is the behavior of comparison operators when arrays are different lengths 
(especially when one array is a prefix of another)? Again, tests needed.

How does the presence of NULL elements in the arrays affect the results of 
comparison? If the arrays are used in {{ORDER BY}} and contain null values (but 
are not null), do the {{NULLS FIRST}} and {{NULLS LAST}} keywords have any 
effect?

> Implement array comparison operators
> ------------------------------------
>
>                 Key: CALCITE-6454
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6454
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Norman Jordan
>            Priority: Major
>
> The comparison operators <, <=, >, >=, =, <> are not implemented for arrays. 
> Here is an example query:
>  
> {code:java}
> SELECT array[2, 2] > array[1, 1]; {code}
> [This 
> page|https://popsql.com/learn-sql/postgresql/how-to-compare-arrays-in-postgresql]
>  describes how the comparisons  work in PostgreSQL.
>  
> Check if the comparison operators for arrays exist in other DB engines.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to