You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (JIRA)" <ji...@apache.org> on 2019/07/31 15:36:00 UTC

[jira] [Resolved] (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 ]

Wenchen Fan resolved SPARK-28153.
---------------------------------
       Resolution: Fixed
         Assignee: Hyukjin Kwon
    Fix Version/s: 3.0.0

> 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: Hyukjin Kwon
>            Priority: Major
>             Fix For: 3.0.0
>
>
> {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.14#76016)

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