cloud-fan commented on code in PR #37573:
URL: https://github.com/apache/spark/pull/37573#discussion_r949734277


##########
connector/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:
##########
@@ -115,11 +115,7 @@ private[sql] class AvroFileFormat extends FileFormat
 
         // Ensure that the reader is closed even if the task fails or doesn't 
consume the entire
         // iterator of records.
-        Option(TaskContext.get()).foreach { taskContext =>
-          taskContext.addTaskCompletionListener[Unit] { _ =>
-            reader.close()
-          }
-        }
+        Option(TaskContext.get()).foreach(_.addTaskCompletionListener(_ => 
reader.close()))

Review Comment:
   are these cleanup possible without removing the overloads with scala lambda?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to