You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2020/05/17 03:21:16 UTC

[hive] branch master updated: HIVE-23376 : Avoid repeated SHA computation in GenericUDTFGetSplits for hive-exec jar (Ramesh Kumar via Rajesh Balamohan)

This is an automated email from the ASF dual-hosted git repository.

hashutosh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new b53a62f  HIVE-23376 : Avoid repeated SHA computation in GenericUDTFGetSplits for hive-exec jar (Ramesh Kumar via Rajesh Balamohan)
b53a62f is described below

commit b53a62ff3b94efd2c9da7b0d805f076e6b1da21e
Author: RAMESH KUMAR THANGARAJAN <ra...@gmail.com>
AuthorDate: Sat May 16 20:20:35 2020 -0700

    HIVE-23376 : Avoid repeated SHA computation in GenericUDTFGetSplits for hive-exec jar (Ramesh Kumar via Rajesh Balamohan)
    
    Signed-off-by: Ashutosh Chauhan <ha...@apache.org>
---
 .../org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
index 7682e1f..9568096 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFGetSplits.java
@@ -128,6 +128,7 @@ import com.google.common.base.Preconditions;
 @UDFType(deterministic = false)
 public class GenericUDTFGetSplits extends GenericUDTF {
   private static final Logger LOG = LoggerFactory.getLogger(GenericUDTFGetSplits.class);
+  private static String sha = null;
 
   protected transient StringObjectInspector stringOI;
   protected transient IntObjectInspector intOI;
@@ -703,7 +704,9 @@ public class GenericUDTFGetSplits extends GenericUDTF {
     Path destDirPath = destDirStatus.getPath();
 
     Path localFile = new Path(localJarPath);
-    String sha = getSha(localFile, conf);
+    if (sha == null || !destDirPath.toString().contains(sha)) {
+      sha = getSha(localFile, conf);
+    }
 
     String destFileName = localFile.getName();