Description
In ElementAt, when first argument is MapType, we should coerce the key type and the second argument based on findTightestCommonType. This is not happening currently.
Also, when the first argument is ArrayType, the second argument should be an integer type or a smaller integral type that can be safely casted to an integer type. Currently we may do an unsafe cast.
spark-sql> select element_at(array(1,2), 1.24); 1
spark-sql> select element_at(map(1,"one", 2, "two"), 2.2); two
Attachments
Attachments
Issue Links
- is a clone of
-
SPARK-25416 ArrayPosition function may return incorrect result when right expression is implicitly downcasted.
- Resolved
- links to