[ 
https://issues.apache.org/jira/browse/SPARK-7903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiangrui Meng closed SPARK-7903.
--------------------------------
    Resolution: Duplicate

> PythonUDT shouldn't get serialized on the Scala side
> ----------------------------------------------------
>
>                 Key: SPARK-7903
>                 URL: https://issues.apache.org/jira/browse/SPARK-7903
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark, SQL
>    Affects Versions: 1.4.0
>            Reporter: Xiangrui Meng
>            Assignee: Xiangrui Meng
>
> A round trip for a pure Python UDT should be: Python UDT -> Python SQL 
> internal types -> Scala/Java SQL internal types -> transformation -> 
> Scala/Java SQL internal types -> Python SQL internal types -> Python UDT. So 
> the serialization shouldn't be invoked on the Scala side if no Scala code is 
> applied to the UDT.
> Code (from [~rams]) to reproduce this bug:
> {code}
> from pyspark.mllib.linalg import SparseVector
> from pyspark.sql.functions import udf
> from pyspark.sql.types import IntegerType
> df = sqlContext.createDataFrame([(SparseVector(2, {0: 0.0}),)], ["features"])
> sz = udf(lambda s: s.size, IntegerType())
> df.select(sz(df.features).alias("sz")).collect()
> {code}



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

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

Reply via email to