phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [13/18] phoenix git commit: PHOENIX-3387 Hive PhoenixStorageHandler fails with join on numeric fields
Date Wed, 02 Nov 2016 20:08:35 GMT
PHOENIX-3387 Hive PhoenixStorageHandler fails with join on numeric fields

Signed-off-by: Sergey Soldatov <ssa@apache.org>


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

Branch: refs/heads/4.x-HBase-1.1
Commit: d9f730a35e65aee24f33d530bb0843a9160bc148
Parents: 4f0dd6a
Author: Sergey Soldatov <ssa@apache.org>
Authored: Thu Oct 20 23:42:39 2016 -0700
Committer: Sergey Soldatov <ssa@apache.org>
Committed: Wed Nov 2 13:01:31 2016 -0700

----------------------------------------------------------------------
 .../it/java/org/apache/phoenix/hive/HiveTestUtil.java    |  1 +
 .../objectinspector/PhoenixBooleanObjectInspector.java   |  5 +++++
 .../hive/objectinspector/PhoenixByteObjectInspector.java |  5 +++++
 .../objectinspector/PhoenixDecimalObjectInspector.java   |  4 ++--
 .../objectinspector/PhoenixDoubleObjectInspector.java    |  5 +++++
 .../objectinspector/PhoenixFloatObjectInspector.java     |  5 +++++
 .../hive/objectinspector/PhoenixIntObjectInspector.java  | 11 +++++++++++
 .../hive/objectinspector/PhoenixLongObjectInspector.java |  5 +++++
 .../objectinspector/PhoenixShortObjectInspector.java     |  7 ++++++-
 9 files changed, 45 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveTestUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveTestUtil.java b/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveTestUtil.java
index a234d24..3407ffb 100644
--- a/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveTestUtil.java
+++ b/phoenix-hive/src/it/java/org/apache/phoenix/hive/HiveTestUtil.java
@@ -567,6 +567,7 @@ public class HiveTestUtil {
 
     public void init() throws Exception {
         testWarehouse = conf.getVar(HiveConf.ConfVars.METASTOREWAREHOUSE);
+        conf.setBoolVar(HiveConf.ConfVars.SUBMITLOCALTASKVIACHILD, false);
         String execEngine = conf.get("hive.execution.engine");
         conf.set("hive.execution.engine", "mr");
         SessionState.start(conf);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixBooleanObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixBooleanObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixBooleanObjectInspector.java
index 0795e14..a767ca0 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixBooleanObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixBooleanObjectInspector.java
@@ -34,6 +34,11 @@ public class PhoenixBooleanObjectInspector extends AbstractPhoenixObjectInspecto
     }
 
     @Override
+    public BooleanWritable getPrimitiveWritableObject(Object o) {
+        return new BooleanWritable(get(o));
+    }
+
+    @Override
     public boolean get(Object o) {
         Boolean value = null;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixByteObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixByteObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixByteObjectInspector.java
index c6c5e95..a19342a 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixByteObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixByteObjectInspector.java
@@ -37,6 +37,11 @@ public class PhoenixByteObjectInspector extends AbstractPhoenixObjectInspector<B
     }
 
     @Override
+    public ByteWritable getPrimitiveWritableObject(Object o) {
+        return new ByteWritable(get(o));
+    }
+
+    @Override
     public byte get(Object o) {
         Byte value = null;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDecimalObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDecimalObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDecimalObjectInspector.java
index 388863a..8afe10f 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDecimalObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDecimalObjectInspector.java
@@ -35,7 +35,7 @@ public class PhoenixDecimalObjectInspector extends
 
     @Override
     public Object copyObject(Object o) {
-        return o == null ? null : new Decimal((Decimal) o);
+        return o == null ? null : new BigDecimal(((BigDecimal)o).byteValue());
     }
 
     @Override
@@ -49,7 +49,7 @@ public class PhoenixDecimalObjectInspector extends
 
         if (o != null) {
             try {
-                value = new HiveDecimalWritable((HiveDecimalWritable) o);
+                value = new HiveDecimalWritable(getPrimitiveJavaObject(o));
             } catch (Exception e) {
                 logExceptionMessage(o, "DECIMAL");
             }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDoubleObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDoubleObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDoubleObjectInspector.java
index 25ae793..9f440ed 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDoubleObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixDoubleObjectInspector.java
@@ -37,6 +37,11 @@ public class PhoenixDoubleObjectInspector extends AbstractPhoenixObjectInspector
     }
 
     @Override
+    public DoubleWritable getPrimitiveWritableObject(Object o) {
+        return new DoubleWritable(get(o));
+    }
+
+    @Override
     public double get(Object o) {
         Double value = null;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixFloatObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixFloatObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixFloatObjectInspector.java
index 83ad2b0..bf1badc 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixFloatObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixFloatObjectInspector.java
@@ -38,6 +38,11 @@ public class PhoenixFloatObjectInspector extends AbstractPhoenixObjectInspector<
     }
 
     @Override
+    public FloatWritable getPrimitiveWritableObject(Object o) {
+        return new FloatWritable(get(o));
+    }
+
+    @Override
     public float get(Object o) {
         Float value = null;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixIntObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixIntObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixIntObjectInspector.java
index fc9e7d0..3511ee3 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixIntObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixIntObjectInspector.java
@@ -17,6 +17,7 @@
  */
 package org.apache.phoenix.hive.objectinspector;
 
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
 import org.apache.hadoop.io.IntWritable;
@@ -34,6 +35,16 @@ public class PhoenixIntObjectInspector extends AbstractPhoenixObjectInspector<In
     }
 
     @Override
+    public Category getCategory() {
+        return Category.PRIMITIVE;
+    }
+
+    @Override
+    public IntWritable getPrimitiveWritableObject(Object o) {
+        return new IntWritable(get(o));
+    }
+
+    @Override
     public int get(Object o) {
         Integer value = null;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixLongObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixLongObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixLongObjectInspector.java
index ad5cd05..554f2a4 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixLongObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixLongObjectInspector.java
@@ -34,6 +34,11 @@ public class PhoenixLongObjectInspector extends AbstractPhoenixObjectInspector<L
     }
 
     @Override
+    public LongWritable getPrimitiveWritableObject(Object o) {
+        return new LongWritable(get(o));
+    }
+
+    @Override
     public long get(Object o) {
         Long value = null;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d9f730a3/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixShortObjectInspector.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixShortObjectInspector.java
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixShortObjectInspector.java
index 1b7ec13..84529b0 100644
--- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixShortObjectInspector.java
+++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixShortObjectInspector.java
@@ -17,9 +17,9 @@
  */
 package org.apache.phoenix.hive.objectinspector;
 
+import org.apache.hadoop.hive.serde2.io.ShortWritable;
 import org.apache.hadoop.hive.serde2.objectinspector.primitive.ShortObjectInspector;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
-import org.apache.hadoop.io.ShortWritable;
 
 public class PhoenixShortObjectInspector extends AbstractPhoenixObjectInspector<ShortWritable>
         implements ShortObjectInspector {
@@ -34,6 +34,11 @@ public class PhoenixShortObjectInspector extends AbstractPhoenixObjectInspector<
     }
 
     @Override
+    public ShortWritable getPrimitiveWritableObject(Object o) {
+        return new ShortWritable(get(o));
+    }
+
+    @Override
     public short get(Object o) {
         Short value = null;
 


Mime
View raw message