hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gop...@apache.org
Subject hive git commit: HIVE-13876: Vectorization: Port HIVE-11544 to LazySimpleDeserializeRead (Gopal V, reviewed by Sergey Shelukhin)
Date Wed, 01 Jun 2016 10:45:00 GMT
Repository: hive
Updated Branches:
  refs/heads/master 789f11b98 -> c57a1272f


HIVE-13876: Vectorization: Port HIVE-11544 to LazySimpleDeserializeRead (Gopal V, reviewed
by Sergey Shelukhin)


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

Branch: refs/heads/master
Commit: c57a1272f2cf50f835417efd08578a49d01ba2cb
Parents: 789f11b
Author: Gopal V <gopalv@apache.org>
Authored: Wed Jun 1 01:33:42 2016 -0700
Committer: Gopal V <gopalv@apache.org>
Committed: Wed Jun 1 03:44:54 2016 -0700

----------------------------------------------------------------------
 .../lazy/fast/LazySimpleDeserializeRead.java    | 27 ++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/c57a1272/serde/src/java/org/apache/hadoop/hive/serde2/lazy/fast/LazySimpleDeserializeRead.java
----------------------------------------------------------------------
diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/lazy/fast/LazySimpleDeserializeRead.java
b/serde/src/java/org/apache/hadoop/hive/serde2/lazy/fast/LazySimpleDeserializeRead.java
index b375d26..7e9f94e 100644
--- a/serde/src/java/org/apache/hadoop/hive/serde2/lazy/fast/LazySimpleDeserializeRead.java
+++ b/serde/src/java/org/apache/hadoop/hive/serde2/lazy/fast/LazySimpleDeserializeRead.java
@@ -270,6 +270,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       }
       break;
     case BYTE:
+      if (!LazyUtils.isNumberMaybe(bytes, fieldStart, fieldLength)) {
+        return true;
+      }
       try {
         currentByte = LazyByte.parseByte(bytes, fieldStart, fieldLength, 10);
       } catch (NumberFormatException e) {
@@ -278,6 +281,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       }
       break;
     case SHORT:
+      if (!LazyUtils.isNumberMaybe(bytes, fieldStart, fieldLength)) {
+        return true;
+      }
       try {
         currentShort = LazyShort.parseShort(bytes, fieldStart, fieldLength, 10);
       } catch (NumberFormatException e) {
@@ -286,6 +292,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       }
       break;
     case INT:
+      if (!LazyUtils.isNumberMaybe(bytes, fieldStart, fieldLength)) {
+        return true;
+      }
       try {
         currentInt = LazyInteger.parseInt(bytes, fieldStart, fieldLength, 10);
       } catch (NumberFormatException e) {
@@ -294,6 +303,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       }
       break;
     case LONG:
+      if (!LazyUtils.isNumberMaybe(bytes, fieldStart, fieldLength)) {
+        return true;
+      }
       try {
         currentLong = LazyLong.parseLong(bytes, fieldStart, fieldLength, 10);
       } catch (NumberFormatException e) {
@@ -303,6 +315,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       break;
     case FLOAT:
       {
+        if (!LazyUtils.isNumberMaybe(bytes, fieldStart, fieldLength)) {
+          return true;
+        }
         String byteData = null;
         try {
           byteData = Text.decode(bytes, fieldStart, fieldLength);
@@ -319,6 +334,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       break;
     case DOUBLE:
       {
+        if (!LazyUtils.isNumberMaybe(bytes, fieldStart, fieldLength)) {
+          return true;
+        }
         String byteData = null;
         try {
           byteData = Text.decode(bytes, fieldStart, fieldLength);
@@ -363,6 +381,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       break;
     case DATE:
       {
+        if (fieldLength == 0) {
+          return true;
+        }
         String s = null;
         try {
           s = Text.decode(bytes, fieldStart, fieldLength);
@@ -375,6 +396,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       break;
     case TIMESTAMP:
       {
+        if (fieldLength == 0) {
+          return true;
+        }
         String s = null;
         try {
           s = new String(bytes, fieldStart, fieldLength, "US-ASCII");
@@ -425,6 +449,9 @@ public final class LazySimpleDeserializeRead extends DeserializeRead {
       break;
     case DECIMAL:
       {
+        if (!LazyUtils.isNumberMaybe(bytes, fieldStart, fieldLength)) {
+          return true;
+        }
         String byteData = null;
         try {
           byteData = Text.decode(bytes, fieldStart, fieldLength);


Mime
View raw message