You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/07/16 06:29:36 UTC

[GitHub] [spark] maropu commented on a change in pull request #24958: [SPARK-28153][PYTHON] Use AtomicReference at InputFileBlockHolder (to support input_file_name with Python UDF)

maropu commented on a change in pull request #24958: [SPARK-28153][PYTHON] Use AtomicReference at InputFileBlockHolder (to support input_file_name with Python UDF)
URL: https://github.com/apache/spark/pull/24958#discussion_r303744926
 
 

 ##########
 File path: python/pyspark/sql/tests/test_functions.py
 ##########
 @@ -294,6 +294,12 @@ def test_input_file_name_reset_for_rdd(self):
         for result in results:
             self.assertEqual(result[0], '')
 
+    def test_input_file_name_udf(self):
+        df = self.spark.read.text('python/test_support/hello/hello.txt')
+        df = df.select(udf(lambda x: x)("value"), input_file_name().alias('file'))
+        file_name = df.collect()[0].file
+        self.assertTrue("python/test_support/hello/hello.txt" in file_name)
 
 Review comment:
   Can't we add a test case in the scala side by using `IntegratedUDFTestUtils`? (I checked the other physical plans using threads (e.g., `SubqueryExec` and `BroadcastExchangeExec`) though, I couldn't find a test query to reproduce this..)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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