viirya 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_r297196148
##########
File path: core/src/main/scala/org/apache/spark/rdd/InputFileBlockHolder.scala
##########
@@ -41,25 +43,26 @@ private[spark] object InputFileBlockHolder {
* The thread variable for the name of the current file being read. This is
used by
* the InputFileName function in Spark SQL.
*/
- private[this] val inputBlock: InheritableThreadLocal[FileBlock] =
- new InheritableThreadLocal[FileBlock] {
- override protected def initialValue(): FileBlock = new FileBlock
+ private[this] val inputBlock:
InheritableThreadLocal[AtomicReference[FileBlock]] =
+ new InheritableThreadLocal[AtomicReference[FileBlock]] {
Review comment:
Does it mean, parent and child threads share the same `FileBlock` object?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]