You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2019/06/25 04:45:00 UTC

[jira] [Assigned] (SPARK-28153) input_file_name doesn't work with Python UDF in the same project

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

Apache Spark reassigned SPARK-28153:
------------------------------------

    Assignee: Apache Spark

> input_file_name doesn't work with Python UDF in the same project
> ----------------------------------------------------------------
>
>                 Key: SPARK-28153
>                 URL: https://issues.apache.org/jira/browse/SPARK-28153
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 3.0.0
>            Reporter: Hyukjin Kwon
>            Assignee: Apache Spark
>            Priority: Major
>
> {code}
> from pyspark.sql.functions import udf, input_file_name
> spark.range(10).write.mode("overwrite").parquet("/tmp/foo")
> spark.read.parquet("/tmp/foo").select(udf(lambda x: x, "long")("id"), input_file_name()).show()
> {code}
> {code}
> +------------+-----------------+
> |<lambda>(id)|input_file_name()|
> +------------+-----------------+
> |           8|                 |
> |           5|                 |
> |           0|                 |
> |           9|                 |
> |           6|                 |
> |           2|                 |
> |           3|                 |
> |           4|                 |
> |           7|                 |
> |           1|                 |
> +------------+-----------------+
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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