[SPARK-24350][SQL] Fixes ClassCastException in the "array_position" function