Repository: hive
Updated Branches:
  refs/heads/master f83d7654e -> 766c3dc21


HIVE-19903: Disable temporary insert-only transactional table (Steve Yeom, 
reviewed by Jason Dere)


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

Branch: refs/heads/master
Commit: 766c3dc21e189afbecace308cd24cd1c5bde09b2
Parents: f83d765
Author: Jason Dere <jd...@hortonworks.com>
Authored: Sun Jun 17 21:38:05 2018 -0700
Committer: Jason Dere <jd...@hortonworks.com>
Committed: Sun Jun 17 21:38:05 2018 -0700

----------------------------------------------------------------------
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java  |  2 +-
 .../test/queries/clientpositive/mm_iow_temp.q   | 15 +++++
 .../results/clientpositive/mm_iow_temp.q.out    | 61 ++++++++++++++++++++
 3 files changed, 77 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/766c3dc2/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 284fcac..c2bcedd 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -12847,7 +12847,7 @@ public class SemanticAnalyzer extends 
BaseSemanticAnalyzer {
         }
       }
     }
-    boolean makeInsertOnly = HiveConf.getBoolVar(conf, 
ConfVars.HIVE_CREATE_TABLES_AS_INSERT_ONLY);
+    boolean makeInsertOnly = !isTemporaryTable && HiveConf.getBoolVar(conf, 
ConfVars.HIVE_CREATE_TABLES_AS_INSERT_ONLY);
     boolean makeAcid = !isTemporaryTable &&
         MetastoreConf.getBoolVar(conf, 
MetastoreConf.ConfVars.CREATE_TABLES_AS_ACID) &&
         HiveConf.getBoolVar(conf, ConfVars.HIVE_SUPPORT_CONCURRENCY) &&

http://git-wip-us.apache.org/repos/asf/hive/blob/766c3dc2/ql/src/test/queries/clientpositive/mm_iow_temp.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/mm_iow_temp.q 
b/ql/src/test/queries/clientpositive/mm_iow_temp.q
new file mode 100644
index 0000000..d6942e4
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/mm_iow_temp.q
@@ -0,0 +1,15 @@
+--! qt:dataset:src
+
+set hive.support.concurrency=true;
+set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+set hive.create.as.insert.only=true;
+
+create temporary table temptable1 (
+  key string,
+  value string
+);
+
+insert overwrite table temptable1 select * from src; 
+
+show create table temptable1;
+select * from temptable1 order by key limit 10;

http://git-wip-us.apache.org/repos/asf/hive/blob/766c3dc2/ql/src/test/results/clientpositive/mm_iow_temp.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/mm_iow_temp.q.out 
b/ql/src/test/results/clientpositive/mm_iow_temp.q.out
new file mode 100644
index 0000000..719a48a
--- /dev/null
+++ b/ql/src/test/results/clientpositive/mm_iow_temp.q.out
@@ -0,0 +1,61 @@
+PREHOOK: query: create temporary table temptable1 (
+  key string,
+  value string
+)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@temptable1
+POSTHOOK: query: create temporary table temptable1 (
+  key string,
+  value string
+)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@temptable1
+PREHOOK: query: insert overwrite table temptable1 select * from src
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@temptable1
+POSTHOOK: query: insert overwrite table temptable1 select * from src
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@temptable1
+POSTHOOK: Lineage: temptable1.key SIMPLE [(src)src.FieldSchema(name:key, 
type:string, comment:default), ]
+POSTHOOK: Lineage: temptable1.value SIMPLE [(src)src.FieldSchema(name:value, 
type:string, comment:default), ]
+PREHOOK: query: show create table temptable1
+PREHOOK: type: SHOW_CREATETABLE
+PREHOOK: Input: default@temptable1
+POSTHOOK: query: show create table temptable1
+POSTHOOK: type: SHOW_CREATETABLE
+POSTHOOK: Input: default@temptable1
+CREATE TEMPORARY TABLE `temptable1`(
+  `key` string, 
+  `value` string)
+ROW FORMAT SERDE 
+  'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' 
+STORED AS INPUTFORMAT 
+  'org.apache.hadoop.mapred.TextInputFormat' 
+OUTPUTFORMAT 
+  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
+LOCATION
+#### A masked pattern was here ####
+TBLPROPERTIES (
+  'bucketing_version'='2')
+PREHOOK: query: select * from temptable1 order by key limit 10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@temptable1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from temptable1 order by key limit 10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@temptable1
+#### A masked pattern was here ####
+0      val_0
+0      val_0
+0      val_0
+10     val_10
+100    val_100
+100    val_100
+103    val_103
+103    val_103
+104    val_104
+104    val_104

Reply via email to