Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-25417

ArrayContains function may return incorrect result when right expression is implicitly down casted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • SQL
    • None

    Description

      In ArrayContains, 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.

      Example :

      spark-sql> select array_position(array(1), 1.34);
      true
      
      
      

       

      spark-sql> select array_position(array(1), 'foo');
      null
      

      Attachments

        Activity

          People

            dkbiswal Dilip Biswal
            dkbiswal Dilip Biswal
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: