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

Eliminate nullcheck code at projection for an array type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • SQL
    • None

    Description

      When we run a spark program with a projection for a array type, nullcheck at a call to write each element of an array is generated. If we know all of the elements do not have null at compilation time, we can eliminate code for nullcheck.

      val df = sparkContext.parallelize(Seq(1.0, 2.0), 1).toDF("v")
      df.selectExpr("Array(v + 2.2, v + 3.3)").collect
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kiszk Kazuaki Ishizaki
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: