izveigor commented on issue #6973:
URL:
https://github.com/apache/arrow-datafusion/issues/6973#issuecomment-1637744611
@jayzhan211 We should accept arrays with all possible dimensions.
But I think you mean that should we use the trick used in `array_concat`
(use different dimensions for input arrays). For example, ClickHouse does not
support the current DataFusion (`array_contains`):
```
SELECT hasAll([[1, 2, 3], [4, 5, 6]], [[1, 2, 3]])
Query id: 4f4aaabd-a56c-4182-96f5-32b53b845fa0
┌─hasAll([[1, 2, 3], [4, 5, 6]], [[1, 2, 3]])─┐
│ 1 │
└─────────────────────────────────────────────┘
1 row in set. Elapsed: 0.001 sec.
```
BUT:
```
SELECT hasAll([[1, 2, 3], [4, 5, 6]], [1, 2, 3])
Query id: 6055996d-8db7-4674-a36b-8d620335ff96
0 rows in set. Elapsed: 0.001 sec.
Received exception from server (version 23.6.2):
Code: 386. DB::Exception: Received from localhost:9000. DB::Exception: There
is no supertype for types Array(UInt8), UInt8 because some of them are Array
and some of them are not: While processing hasAll([[1, 2, 3], [4, 5, 6]], [1,
2, 3]). (NO_COMMON_TYPE)
```
Against, PostgreSQL supports our version:
```
postgres=# select array[array[array[1, 2, 3], array[4, 5, 6]],
array[array[4, 5, 6], array[7, 8, 9]]] @> array[1, 2, 3];
?column?
----------
t
(1 row)
```
I really don't know which version we should follow. Therefore, in this
matter, I trust your taste.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]