Repository: hive Updated Branches: refs/heads/master e709f7a89 -> b153a6b1e
HIVE-18816 : CREATE TABLE (ACID) doesn't work with TIMESTAMPLOCALTZ column type (Igor Kryvenko via Ashutosh Chauhan) Signed-off-by: Ashutosh Chauhan <hashut...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b153a6b1 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b153a6b1 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b153a6b1 Branch: refs/heads/master Commit: b153a6b1eff5bffadfb8b24cb5b305b9fd2c9c3e Parents: e709f7a Author: Igor Kryvenko <kryvenko7i...@gmail.com> Authored: Sat Apr 14 10:11:14 2018 -0700 Committer: Ashutosh Chauhan <hashut...@apache.org> Committed: Sat Apr 14 10:11:14 2018 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java | 2 ++ .../queries/clientpositive/orc_timestamplocaltz_type.q | 5 +++++ .../clientpositive/orc_timestamplocaltz_type.q.out | 10 ++++++++++ 3 files changed, 17 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/b153a6b1/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java index 9e476fa..c81bcfe 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcStruct.java @@ -542,6 +542,8 @@ final public class OrcStruct implements Writable { case DECIMAL: return PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector( (PrimitiveTypeInfo)info); + case TIMESTAMPLOCALTZ: + return PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector((PrimitiveTypeInfo) info); default: throw new IllegalArgumentException("Unknown primitive type " + ((PrimitiveTypeInfo) info).getPrimitiveCategory()); http://git-wip-us.apache.org/repos/asf/hive/blob/b153a6b1/ql/src/test/queries/clientpositive/orc_timestamplocaltz_type.q ---------------------------------------------------------------------- diff --git a/ql/src/test/queries/clientpositive/orc_timestamplocaltz_type.q b/ql/src/test/queries/clientpositive/orc_timestamplocaltz_type.q new file mode 100644 index 0000000..fbe702e --- /dev/null +++ b/ql/src/test/queries/clientpositive/orc_timestamplocaltz_type.q @@ -0,0 +1,5 @@ +set hive.support.concurrency=true; +set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; + +CREATE TABLE table_acid(d int, tz timestamp with local time zone) + clustered by (d) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true'); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hive/blob/b153a6b1/ql/src/test/results/clientpositive/orc_timestamplocaltz_type.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientpositive/orc_timestamplocaltz_type.q.out b/ql/src/test/results/clientpositive/orc_timestamplocaltz_type.q.out new file mode 100644 index 0000000..fe3bb5c --- /dev/null +++ b/ql/src/test/results/clientpositive/orc_timestamplocaltz_type.q.out @@ -0,0 +1,10 @@ +PREHOOK: query: CREATE TABLE table_acid(d int, tz timestamp with local time zone) + clustered by (d) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true') +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@table_acid +POSTHOOK: query: CREATE TABLE table_acid(d int, tz timestamp with local time zone) + clustered by (d) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true') +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@table_acid