[CALCITE-6454] Implement array comparison operators#3852
[CALCITE-6454] Implement array comparison operators#3852mihaibudiu merged 1 commit intoapache:mainfrom
Conversation
normanj-bitquill
commented
Jul 10, 2024
- <, <=, >, >= now work for arrays and rows
- Can also sort arrays and rows
- Comparison is performed along corresponding indexes
- Longer arrays are considered greater
- null is considered greater than anything
- Cannot change whether nulls are first or last
mihaibudiu
left a comment
There was a problem hiding this comment.
the natural question is whether this works for other recursive types, such as int array array...
@mihaibudiu I'm not sure. This PR currently handles arrays and rows. The arrays and rows can contain scalar values as well as arrays and rows. Do you have any examples of simple queries that could generate other types? I can generate an array in a query with |
But this maybe another issue to resolve it.
|
There are some examples in SqlOperatorTest.java, for instance nested arrays: |
|
@mihaibudiu I have fixed an issue with comparing rows and added tests with nesting (arrays in arrays, rows in arrays, etc). |
|
* <, <=, >, >= now work for arrays and rows * Can also sort arrays and rows * Comparison is performed along corresponding indexes * Longer arrays are considered greater * null is considered greater than anything * Cannot change whether nulls are first or last
81b0e92 to
4743e07
Compare
|


