From dc24aecd8fc8b5d9b19c10e8301dbe1107412c8a Mon Sep 17 00:00:00 2001 From: Matei Zaharia Date: Thu, 10 Feb 2011 11:20:51 -0800 Subject: [PATCH] Close record readers in HadoopFile after finishing a split --- core/src/main/scala/spark/HadoopFile.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/scala/spark/HadoopFile.scala b/core/src/main/scala/spark/HadoopFile.scala index a63c9d8a94..629dcc7da5 100644 --- a/core/src/main/scala/spark/HadoopFile.scala +++ b/core/src/main/scala/spark/HadoopFile.scala @@ -76,6 +76,9 @@ extends RDD[(K, V)](sc) { } gotNext = true } + if (finished) { + reader.close() + } !finished }