You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Maciej Szymkiewicz (JIRA)" <ji...@apache.org> on 2017/02/01 17:55:51 UTC
[jira] [Created] (SPARK-19427) UserDefinedFunction should support
data types strings
Maciej Szymkiewicz created SPARK-19427:
------------------------------------------
Summary: UserDefinedFunction should support data types strings
Key: SPARK-19427
URL: https://issues.apache.org/jira/browse/SPARK-19427
Project: Spark
Issue Type: Sub-task
Components: PySpark, SQL
Affects Versions: 2.1.0, 2.0.0
Reporter: Maciej Szymkiewicz
PySpark SQL supports casting using data type strings.
{code}
from pyspark.sql.functions import col
col("foo").cast("integer")
{code}
It should be possible to do the same with {{udf}} / {{UserDefinedFunction}}:
{code}
from pyspark.sql import udf
udf(lambda x: x + 1, "integer")
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org