Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-28153

Use AtomicReference at InputFileBlockHolder (to support input_file_name with Python UDF)

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.3, 2.4.3, 3.0.0
    • Fix Version/s: 2.4.4, 3.0.0
    • Component/s: PySpark
    • Labels:
      None

      Description

      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()
      
      +------------+-----------------+
      |<lambda>(id)|input_file_name()|
      +------------+-----------------+
      |           8|                 |
      |           5|                 |
      |           0|                 |
      |           9|                 |
      |           6|                 |
      |           2|                 |
      |           3|                 |
      |           4|                 |
      |           7|                 |
      |           1|                 |
      +------------+-----------------+
      

        Attachments

        Issue Links

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

            • Assignee:
              hyukjin.kwon Hyukjin Kwon Assign to me
              Reporter:
              hyukjin.kwon Hyukjin Kwon

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment