drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [06/16] incubator-drill git commit: DRILL-1639: Close Hive resources
Date Wed, 12 Nov 2014 04:11:23 GMT
DRILL-1639: Close Hive resources


Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/25fca623
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/25fca623
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/25fca623

Branch: refs/heads/master
Commit: 25fca623f579570807a6ca8f61b7a81c7b019f4a
Parents: abab3d3
Author: Jacques Nadeau <jacques@apache.org>
Authored: Wed Nov 5 08:55:19 2014 -0800
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Tue Nov 11 16:48:44 2014 -0800

----------------------------------------------------------------------
 .../org/apache/drill/exec/store/hive/HiveRecordReader.java   | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/25fca623/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveRecordReader.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveRecordReader.java
b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveRecordReader.java
index 0f59095..625a7b2 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveRecordReader.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveRecordReader.java
@@ -42,6 +42,7 @@ import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.ops.OperatorContext;
 import org.apache.drill.exec.physical.impl.OutputMutator;
 import org.apache.drill.exec.record.MaterializedField;
+import org.apache.drill.exec.rpc.ProtobufLengthDecoder;
 import org.apache.drill.exec.store.AbstractRecordReader;
 import org.apache.drill.exec.util.DecimalUtility;
 import org.apache.drill.exec.vector.BigIntVector;
@@ -91,6 +92,8 @@ import com.google.common.collect.Lists;
 
 public class HiveRecordReader extends AbstractRecordReader {
 
+  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HiveRecordReader.class);
+
   protected Table table;
   protected Partition partition;
   protected InputSplit inputSplit;
@@ -348,6 +351,11 @@ public class HiveRecordReader extends AbstractRecordReader {
 
   @Override
   public void cleanup() {
+    try {
+      reader.close();
+    } catch (Exception e) {
+      logger.warn("Failure while closing Hive Record reader.", e);
+    }
   }
 
   public static MinorType getMinorTypeFromHivePrimitiveTypeInfo(PrimitiveTypeInfo primitiveTypeInfo)
{


Mime
View raw message