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

[jira] [Assigned] (SPARK-28153) Use AtomicReference at InputFileBlockHolder (to support input_file_name with Python UDF)

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

Hyukjin Kwon reassigned SPARK-28153:
------------------------------------

    Assignee: Hyukjin Kwon

> Use AtomicReference at InputFileBlockHolder (to support input_file_name with Python UDF)
> ----------------------------------------------------------------------------------------
>
>                 Key: SPARK-28153
>                 URL: https://issues.apache.org/jira/browse/SPARK-28153
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 2.3.3, 3.0.0, 2.4.3
>            Reporter: Hyukjin Kwon
>            Assignee: Hyukjin Kwon
>            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.14#76016)

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