You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Franklyn Dsouza (JIRA)" <ji...@apache.org> on 2016/06/07 23:55:21 UTC

[jira] [Created] (SPARK-15811) UDFs do not work in Spark 2.0-preview built with scala 2.10

Franklyn Dsouza created SPARK-15811:
---------------------------------------

             Summary: UDFs do not work in Spark 2.0-preview built with scala 2.10
                 Key: SPARK-15811
                 URL: https://issues.apache.org/jira/browse/SPARK-15811
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 2.0.0
            Reporter: Franklyn Dsouza
            Priority: Blocker
             Fix For: 2.0.0


I've built spark-2.0-preview (8f5a04b) with scala-2.10 using the following

./dev/change-version-to-2.10.sh
./dev/make-distribution.sh -DskipTests -Dzookeeper.version=3.4.5 -Dcurator.version=2.4.0 -Dscala-2.10 -Phadoop-2.6  -Pyarn -Phive

and then ran the following code in a pyspark shell

from pyspark.sql import SparkSession
from pyspark.sql.types import IntegerType, StructField, StructType
from pyspark.sql.functions import udf
from pyspark.sql.types import Row
spark = SparkSession.builder.master('local[4]').appName('2.0 DF').getOrCreate()
add_one = udf(lambda x: x + 1, IntegerType())
schema = StructType([StructField('a', IntegerType(), False)])
df = spark.createDataFrame([Row(a=1),Row(a=2)], schema)
df.select(add_one(df.a).alias('incremented')).collect()

This never returns with a result. 




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org