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

ClassCastException when a generator having nested inner generators

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.5, 3.0.0, 3.1.0
    • Fix Version/s: 2.4.6, 3.0.0
    • Component/s: SQL
    • Labels:
      None

      Description

      A query below failed in the master/branch-3.0/branch-2.4;

      scala> sql("select array(array(1, 2), array(3)) ar").select(explode(explode($"ar"))).show()
      20/03/01 13:51:56 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)/ 1]
      java.lang.ClassCastException: scala.collection.mutable.ArrayOps$ofRef cannot be cast to org.apache.spark.sql.catalyst.util.ArrayData
      	at org.apache.spark.sql.catalyst.expressions.ExplodeBase.eval(generators.scala:313)
      	at org.apache.spark.sql.execution.GenerateExec.$anonfun$doExecute$8(GenerateExec.scala:108)
      	at scala.collection.Iterator$$anon$11.nextCur(Iterator.scala:484)
      	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:490)
      	at scala.collection.Iterator$ConcatIterator.hasNext(Iterator.scala:222)
      	at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:458)
          ...
      

        Attachments

          Activity

            People

            • Assignee:
              maropu Takeshi Yamamuro
              Reporter:
              maropu Takeshi Yamamuro
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: