Description
In ArrayRemove, we currently cast the right hand side expression to match the element type of the left hand side Array. This may result in down casting and may return wrong result or questionable result.
spark-sql> select array_remove(array(1,2,3), 1.23D)
> ;
[2,3]
Time taken: 2.57 seconds, Fetched 1 row(s)
spark-sql> select array_remove(array(1,2,3), 'foo')
> ;
NULL
We should safely coerce both left and right hand side expressions.
Attachments
Issue Links
- is a clone of
-
SPARK-25416 ArrayPosition function may return incorrect result when right expression is implicitly downcasted.
- Resolved
- links to