drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meh...@apache.org
Subject [6/7] drill git commit: DRILL-2729: Fix deserialization issues with Hive decimal type partition columns.
Date Sat, 11 Apr 2015 04:47:11 GMT
DRILL-2729: Fix deserialization issues with Hive decimal type partition columns.


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

Branch: refs/heads/master
Commit: f71814441bc032028ac2b45658a6956b42c6555d
Parents: 4e9a17e
Author: vkorukanti <venki.korukanti@gmail.com>
Authored: Wed Apr 8 19:14:14 2015 -0700
Committer: Mehant Baid <mehantr@gmail.com>
Committed: Fri Apr 10 21:21:31 2015 -0700

----------------------------------------------------------------------
 .../apache/drill/exec/store/hive/HiveRecordReader.java  |  4 ++--
 .../org/apache/drill/exec/hive/TestHiveStorage.java     | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/f7181444/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 69c50ea..8c400ea 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
@@ -541,7 +541,7 @@ public class HiveRecordReader extends AbstractRecordReader {
       Decimal9Holder holder = new Decimal9Holder();
       holder.scale = scale;
       holder.precision = precision;
-      holder.value = DecimalUtility.getDecimal9FromBigDecimal(bigDecimal, precision, scale);
+      holder.value = DecimalUtility.getDecimal9FromBigDecimal(bigDecimal, scale, precision);
       Decimal9Vector v = (Decimal9Vector) vector;
       for (int j = 0; j < recordCount; j++) {
         v.getMutator().setSafe(j, holder);
@@ -550,7 +550,7 @@ public class HiveRecordReader extends AbstractRecordReader {
       Decimal18Holder holder = new Decimal18Holder();
       holder.scale = scale;
       holder.precision = precision;
-      holder.value = DecimalUtility.getDecimal18FromBigDecimal(bigDecimal, precision, scale);
+      holder.value = DecimalUtility.getDecimal18FromBigDecimal(bigDecimal, scale, precision);
       Decimal18Vector v = (Decimal18Vector) vector;
       for (int j = 0; j < recordCount; j++) {
         v.getMutator().setSafe(j, holder);

http://git-wip-us.apache.org/repos/asf/drill/blob/f7181444/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/TestHiveStorage.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/TestHiveStorage.java
b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/TestHiveStorage.java
index e3330c6..03747bf 100644
--- a/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/TestHiveStorage.java
+++ b/contrib/storage-hive/core/src/test/java/org/apache/drill/exec/hive/TestHiveStorage.java
@@ -106,9 +106,9 @@ public class TestHiveStorage extends HiveTestBase {
             "binary",
             true,
             (byte) 64,
-            new BigDecimal("370000000000"),   // TODO(DRILL-2729) Should be 37
-            new BigDecimal("369000.00"),      // TODO(DRILL-2729) Should be 36.90
-            new BigDecimal("-66367900898250.61888"), // TODO(DRILL-2729) Should be 3289379872.94565
+            new BigDecimal("37"),
+            new BigDecimal("36.90"),
+            new BigDecimal("3289379872.94565"),
             new BigDecimal("39579334534534.4"),
             new BigDecimal("363945093845093890.900"),
             8.345d,
@@ -129,9 +129,9 @@ public class TestHiveStorage extends HiveTestBase {
             "binary",
             true,
             (byte) 64,
-            new BigDecimal("370000000000"),  // TODO(DRILL-2729) Should be 37
-            new BigDecimal("369000.00"), // TODO(DRILL-2729) Should be 36.90
-            new BigDecimal("-66367900898250.61888"), // TODO(DRILL-2729) Should be 3289379872.94565
+            new BigDecimal("37"),
+            new BigDecimal("36.90"),
+            new BigDecimal("3289379872.94565"),
             new BigDecimal("39579334534534.4"),
             new BigDecimal("363945093845093890.900"),
             8.345d,


Mime
View raw message