hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject svn commit: r1633231 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsNoJobTask.java
Date Mon, 20 Oct 2014 21:27:55 GMT
Author: prasanthj
Date: Mon Oct 20 21:27:54 2014
New Revision: 1633231

URL: http://svn.apache.org/r1633231
Log:
HIVE-8497: StatsNoJobTask doesn't close RecordReader, FSDataInputStream of which keeps open
to prevent stale data clean (Xiaobing Zhou via Prasanth J)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsNoJobTask.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsNoJobTask.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsNoJobTask.java?rev=1633231&r1=1633230&r2=1633231&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsNoJobTask.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsNoJobTask.java Mon Oct 20 21:27:54
2014
@@ -153,7 +153,9 @@ public class StatsNoJobTask extends Task
                 partn.getInputFormatClass(), jc);
             InputSplit dummySplit = new FileSplit(file.getPath(), 0, 0,
                 new String[] { partn.getLocation() });
-            Object recordReader = inputFormat.getRecordReader(dummySplit, jc, Reporter.NULL);
+            org.apache.hadoop.mapred.RecordReader<?, ?> recordReader =
+                (org.apache.hadoop.mapred.RecordReader<?, ?>)
+                inputFormat.getRecordReader(dummySplit, jc, Reporter.NULL);
             StatsProvidingRecordReader statsRR;
             if (recordReader instanceof StatsProvidingRecordReader) {
               statsRR = (StatsProvidingRecordReader) recordReader;
@@ -163,6 +165,7 @@ public class StatsNoJobTask extends Task
               numFiles += 1;
               statsAvailable = true;
             }
+            recordReader.close();
           }
         }
 
@@ -254,6 +257,7 @@ public class StatsNoJobTask extends Task
                 numFiles += 1;
                 statsAvailable = true;
               }
+              recordReader.close();
             }
           }
 



Mime
View raw message