Github user dilipbiswal commented on the issue:
https://github.com/apache/spark/pull/22408
@ushin @gatorsmile Here are the results from presto. Please let me know if
you want me try any case in particular. One thing to note is that presto allows
comparison between int and decimal. In our `findTightestCommonType` we don't do
the promotion.
``` SQL
presto:default> select contains(array[1,2,3], '1');
Query 20180914_053612_00006_pru6h failed: line 1:8: Unexpected parameters
(array(integer), varchar(1)) for function contains. Expected:
contains(array(T), T) T:comparable
select contains(array[1,2,3], '1')
presto:default> select contains(array[1,2,3], 'foo');
Query 20180914_053729_00007_pru6h failed: line 1:8: Unexpected parameters
(array(integer), varchar(3)) for function contains. Expected:
contains(array(T), T) T:comparable
select contains(array[1,2,3], 'foo')
presto:default> select contains(array['1','2','3'], 1);
Query 20180914_053850_00008_pru6h failed: line 1:8: Unexpected parameters
(array(varchar(1)), integer) for function contains. Expected:
contains(array(T), T) T:comparable
select contains(array['1','2','3'], 1)
presto:default> select contains(array[1,2,3], cast(1.0 as decimal(10,2)));
_col0
-------
true
(1 row)
presto:default> select contains(array[1,2,3], cast(1.0 as double));
_col0
-------
true
(1 row)
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]