PHOENIX-3423 PhoenixObjectInspector doesn't have information on length of the column.
Signed-off-by: Sergey Soldatov <s...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/b477f370 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b477f370 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b477f370 Branch: refs/heads/master Commit: b477f370c0519d5f5385927d3809fb4a5433a2ec Parents: a37403c Author: Jeongdae Kim <kjd9...@gmail.com> Authored: Mon Oct 31 12:36:00 2016 +0900 Committer: Sergey Soldatov <s...@apache.org> Committed: Wed Nov 2 12:38:44 2016 -0700 ---------------------------------------------------------------------- .../hive/objectinspector/PhoenixCharObjectInspector.java | 7 ++++++- .../hive/objectinspector/PhoenixObjectInspectorFactory.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/b477f370/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixCharObjectInspector.java ---------------------------------------------------------------------- diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixCharObjectInspector.java b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixCharObjectInspector.java index 8d6aa8c..17222a2 100644 --- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixCharObjectInspector.java +++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixCharObjectInspector.java @@ -20,6 +20,7 @@ package org.apache.phoenix.hive.objectinspector; import org.apache.hadoop.hive.common.type.HiveChar; import org.apache.hadoop.hive.serde2.io.HiveCharWritable; import org.apache.hadoop.hive.serde2.objectinspector.primitive.HiveCharObjectInspector; +import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; /** @@ -29,7 +30,11 @@ public class PhoenixCharObjectInspector extends AbstractPhoenixObjectInspector<H implements HiveCharObjectInspector { public PhoenixCharObjectInspector() { - super(TypeInfoFactory.charTypeInfo); + this(TypeInfoFactory.charTypeInfo); + } + + public PhoenixCharObjectInspector(PrimitiveTypeInfo type) { + super(type); } @Override http://git-wip-us.apache.org/repos/asf/phoenix/blob/b477f370/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixObjectInspectorFactory.java ---------------------------------------------------------------------- diff --git a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixObjectInspectorFactory.java b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixObjectInspectorFactory.java index 22be0fc..3a19ea7 100644 --- a/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixObjectInspectorFactory.java +++ b/phoenix-hive/src/main/java/org/apache/phoenix/hive/objectinspector/PhoenixObjectInspectorFactory.java @@ -102,7 +102,7 @@ public class PhoenixObjectInspectorFactory { serdeParams.getEscapeChar()); break; case CHAR: - oi = new PhoenixCharObjectInspector(); + oi = new PhoenixCharObjectInspector((PrimitiveTypeInfo)type); break; case DATE: oi = new PhoenixDateObjectInspector();