java.lang.UnsupportedOperationException: Cannot evaluate expression: PythonUDF#<lambda>(input[2, StringType])

Stack Overflow | user5147250 | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 1

    Spark-Submit python file on cluster

    Stack Overflow | 8 months ago | user5147250
    java.lang.UnsupportedOperationException: Cannot evaluate expression: PythonUDF#<lambda>(input[2, StringType])

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      Cannot evaluate expression: PythonUDF#<lambda>(input[2, StringType])

      at org.apache.spark.sql.catalyst.expressions.Unevaluable$class.genCode()
    2. Spark Project Catalyst
      Unevaluable$class.genCode
      1. org.apache.spark.sql.catalyst.expressions.Unevaluable$class.genCode(Expression.scala:191)
      1 frame
    3. Spark Project SQL
      PythonUDF.genCode
      1. org.apache.spark.sql.execution.PythonUDF.genCode(python.scala:44)
      1 frame
    4. Spark Project Catalyst
      GenerateMutableProjection$$anonfun$1.apply
      1. org.apache.spark.sql.catalyst.expressions.Expression.gen(Expression.scala:98)
      2. org.apache.spark.sql.catalyst.expressions.codegen.GenerateMutableProjection$$anonfun$1.apply(GenerateMutableProjection.scala:46)
      3. org.apache.spark.sql.catalyst.expressions.codegen.GenerateMutableProjection$$anonfun$1.apply(GenerateMutableProjection.scala:43)
      3 frames
    5. Scala
      AbstractTraversable.map
      1. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      2. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      3. scala.collection.immutable.List.foreach(List.scala:318)
      4. scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
      5. scala.collection.AbstractTraversable.map(Traversable.scala:105)
      5 frames
    6. Spark Project Catalyst
      CodeGenerator.generate
      1. org.apache.spark.sql.catalyst.expressions.codegen.GenerateMutableProjection$.create(GenerateMutableProjection.scala:43)
      2. org.apache.spark.sql.catalyst.expressions.codegen.GenerateMutableProjection$.create(GenerateMutableProjection.scala:33)
      3. org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator.generate(CodeGenerator.scala:425)
      4. org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator.generate(CodeGenerator.scala:422)
      4 frames
    7. Spark Project SQL
      BatchPythonEvaluation$$anonfun$doExecute$1.apply
      1. org.apache.spark.sql.execution.SparkPlan.newMutableProjection(SparkPlan.scala:255)
      2. org.apache.spark.sql.execution.BatchPythonEvaluation$$anonfun$doExecute$1.apply(python.scala:370)
      3. org.apache.spark.sql.execution.BatchPythonEvaluation$$anonfun$doExecute$1.apply(python.scala:362)
      3 frames
    8. Spark
      Executor$TaskRunner.run
      1. org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$17.apply(RDD.scala:710)
      2. org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$17.apply(RDD.scala:710)
      3. org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
      4. org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:300)
      5. org.apache.spark.rdd.RDD.iterator(RDD.scala:264)
      6. org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
      7. org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:300)
      8. org.apache.spark.rdd.RDD.iterator(RDD.scala:264)
      9. org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
      10. org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:300)
      11. org.apache.spark.rdd.RDD.iterator(RDD.scala:264)
      12. org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
      13. org.apache.spark.scheduler.Task.run(Task.scala:88)
      14. org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
      14 frames
    9. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames