Repository: hive
Updated Branches:
  refs/heads/master-txnstats cf888808e -> 648ab648f


HIVE-19934 : Verify ACID table UPDATE/DELETE commands on transactional stats 
(Sergey Shelukhin)


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

Branch: refs/heads/master-txnstats
Commit: 648ab648f70abe739a447bc6f9066dbdf2a0d790
Parents: cf88880
Author: sergey <[email protected]>
Authored: Wed Jun 27 17:46:32 2018 -0700
Committer: sergey <[email protected]>
Committed: Wed Jun 27 17:46:32 2018 -0700

----------------------------------------------------------------------
 .../test/queries/clientpositive/acid_stats2.q   |  42 ++++
 .../results/clientpositive/acid_stats2.q.out    | 237 +++++++++++++++++++
 2 files changed, 279 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/648ab648/ql/src/test/queries/clientpositive/acid_stats2.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/acid_stats2.q 
b/ql/src/test/queries/clientpositive/acid_stats2.q
new file mode 100644
index 0000000..cf96731
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/acid_stats2.q
@@ -0,0 +1,42 @@
+set hive.stats.dbclass=fs;
+set hive.stats.fetch.column.stats=true;
+set datanucleus.cache.collections=false;
+
+set hive.merge.mapfiles=false;
+set hive.merge.mapredfiles=false;
+
+set hive.stats.autogather=true;
+set hive.stats.column.autogather=true;
+set hive.compute.query.using.stats=true;
+set hive.mapred.mode=nonstrict;
+set hive.explain.user=false;
+
+set hive.fetch.task.conversion=none;
+set hive.support.concurrency=true;
+set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+set hive.query.results.cache.enabled=false;
+
+create table stats3(key int,value string) stored as orc tblproperties 
("transactional"="true");
+insert into table stats3  values (1, "foo");
+explain select count(*) from stats3;
+select count(*) from stats3;
+insert into table stats3  values (2, "bar");
+explain select count(*) from stats3;
+select count(*) from stats3;
+update stats3 set value = "baz" where key = 4;
+explain select count(*) from stats3;
+select count(*) from stats3;
+update stats3 set value = "baz" where key = 1;
+explain select count(*) from stats3;
+select count(*) from stats3;
+delete from stats3 where key = 3;
+explain select count(*) from stats3;
+select count(*) from stats3;
+delete from stats3 where key = 1;
+explain select count(*) from stats3;
+select count(*) from stats3;
+delete from stats3 where key = 2;
+explain select count(*) from stats3;
+select count(*) from stats3;
+
+drop table stats3;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/648ab648/ql/src/test/results/clientpositive/acid_stats2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/acid_stats2.q.out 
b/ql/src/test/results/clientpositive/acid_stats2.q.out
new file mode 100644
index 0000000..5fc0505
--- /dev/null
+++ b/ql/src/test/results/clientpositive/acid_stats2.q.out
@@ -0,0 +1,237 @@
+PREHOOK: query: create table stats3(key int,value string) stored as orc 
tblproperties ("transactional"="true")
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@stats3
+POSTHOOK: query: create table stats3(key int,value string) stored as orc 
tblproperties ("transactional"="true")
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@stats3
+PREHOOK: query: insert into table stats3  values (1, "foo")
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@stats3
+POSTHOOK: query: insert into table stats3  values (1, "foo")
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@stats3
+POSTHOOK: Lineage: stats3.key SCRIPT []
+POSTHOOK: Lineage: stats3.value SCRIPT []
+PREHOOK: query: explain select count(*) from stats3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(*) from stats3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from stats3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from stats3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+#### A masked pattern was here ####
+1
+PREHOOK: query: insert into table stats3  values (2, "bar")
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@stats3
+POSTHOOK: query: insert into table stats3  values (2, "bar")
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@stats3
+POSTHOOK: Lineage: stats3.key SCRIPT []
+POSTHOOK: Lineage: stats3.value SCRIPT []
+PREHOOK: query: explain select count(*) from stats3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(*) from stats3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from stats3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from stats3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+#### A masked pattern was here ####
+2
+PREHOOK: query: update stats3 set value = "baz" where key = 4
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+PREHOOK: Output: default@stats3
+POSTHOOK: query: update stats3 set value = "baz" where key = 4
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+POSTHOOK: Output: default@stats3
+PREHOOK: query: explain select count(*) from stats3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(*) from stats3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from stats3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from stats3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+#### A masked pattern was here ####
+2
+PREHOOK: query: update stats3 set value = "baz" where key = 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+PREHOOK: Output: default@stats3
+POSTHOOK: query: update stats3 set value = "baz" where key = 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+POSTHOOK: Output: default@stats3
+PREHOOK: query: explain select count(*) from stats3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(*) from stats3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from stats3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from stats3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+#### A masked pattern was here ####
+2
+PREHOOK: query: delete from stats3 where key = 3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+PREHOOK: Output: default@stats3
+POSTHOOK: query: delete from stats3 where key = 3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+POSTHOOK: Output: default@stats3
+PREHOOK: query: explain select count(*) from stats3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(*) from stats3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from stats3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from stats3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+#### A masked pattern was here ####
+2
+PREHOOK: query: delete from stats3 where key = 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+PREHOOK: Output: default@stats3
+POSTHOOK: query: delete from stats3 where key = 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+POSTHOOK: Output: default@stats3
+PREHOOK: query: explain select count(*) from stats3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(*) from stats3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from stats3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from stats3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+#### A masked pattern was here ####
+1
+PREHOOK: query: delete from stats3 where key = 2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+PREHOOK: Output: default@stats3
+POSTHOOK: query: delete from stats3 where key = 2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+POSTHOOK: Output: default@stats3
+PREHOOK: query: explain select count(*) from stats3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select count(*) from stats3
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select count(*) from stats3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@stats3
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from stats3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@stats3
+#### A masked pattern was here ####
+0
+PREHOOK: query: drop table stats3
+PREHOOK: type: DROPTABLE
+PREHOOK: Input: default@stats3
+PREHOOK: Output: default@stats3
+POSTHOOK: query: drop table stats3
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Input: default@stats3
+POSTHOOK: Output: default@stats3

Reply via email to