HIVE-12768 : Thread safety: binary sortable serde decimal deserialization 
(Vikram Dixit K, reviewed by Gunther Hagleitner, Sergey Shelukhin)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/06f8d74f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/06f8d74f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/06f8d74f

Branch: refs/heads/branch-2.0
Commit: 06f8d74f7886a1724b5daaecf03bc49b8c4b1080
Parents: b277f8a
Author: Sergey Shelukhin <[email protected]>
Authored: Mon Jan 11 13:33:06 2016 -0800
Committer: Sergey Shelukhin <[email protected]>
Committed: Mon Jan 11 13:33:29 2016 -0800

----------------------------------------------------------------------
 .../hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java  | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/06f8d74f/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java
----------------------------------------------------------------------
diff --git 
a/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java
 
b/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java
index 2796011..144ea5a 100644
--- 
a/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java
+++ 
b/serde/src/java/org/apache/hadoop/hive/serde2/binarysortable/BinarySortableSerDe.java
@@ -131,7 +131,6 @@ public class BinarySortableSerDe extends AbstractSerDe {
 
   boolean[] columnSortOrderIsDesc;
 
-  private static byte[] decimalBuffer = null;
   public static Charset decimalCharSet = Charset.forName("US-ASCII");
 
   @Override
@@ -426,9 +425,7 @@ public class BinarySortableSerDe extends AbstractSerDe {
           length++;
         } while (true);
 
-        if(decimalBuffer == null || decimalBuffer.length < length) {
-          decimalBuffer = new byte[length];
-        }
+        final byte[] decimalBuffer = new byte[length];
 
         buffer.seek(start);
         for (int i = 0; i < length; ++i) {

Reply via email to