FAQ
Author: gates
Date: Fri Nov 7 17:40:30 2014
New Revision: 1637419

URL: http://svn.apache.org/r1637419
Log:
HIVE-8710 Add more tests for transactional inserts (Alan Gates, reviewed by Eugene Koifman)

Added:
     hive/trunk/ql/src/test/queries/clientpositive/acid_join.q
     hive/trunk/ql/src/test/queries/clientpositive/insert_nonacid_from_acid.q
     hive/trunk/ql/src/test/results/clientpositive/acid_join.q.out
     hive/trunk/ql/src/test/results/clientpositive/insert_nonacid_from_acid.q.out

Added: hive/trunk/ql/src/test/queries/clientpositive/acid_join.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/acid_join.q?rev=1637419&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/acid_join.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/acid_join.q Fri Nov 7 17:40:30 2014
@@ -0,0 +1,15 @@
+set hive.support.concurrency=true;
+set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+set hive.enforce.bucketing=true;
+
+-- This test checks that a join with tables with two different buckets send the right bucket info to each table.
+create table acidjoin1(name varchar(50), age int) clustered by (age) into 2 buckets stored as orc TBLPROPERTIES ("transactional"="true");
+create table acidjoin2(name varchar(50), gpa decimal(3, 2)) clustered by (gpa) into 4 buckets stored as orc TBLPROPERTIES ("transactional"="true");
+create table acidjoin3(name varchar(50), age int, gpa decimal(3, 2)) clustered by (gpa) into 8 buckets stored as orc TBLPROPERTIES ("transactional"="true");
+
+insert into table acidjoin1 values ('aaa', 35), ('bbb', 32), ('ccc', 32), ('ddd', 35), ('eee', 32);
+insert into table acidjoin2 values ('aaa', 3.00), ('bbb', 3.01), ('ccc', 3.02), ('ddd', 3.03), ('eee', 3.04);
+
+insert into table acidjoin3 select a.name, age, gpa from acidjoin1 a join acidjoin2 b on (a.name = b.name);
+select * from acidjoin3 order by name;
+

Added: hive/trunk/ql/src/test/queries/clientpositive/insert_nonacid_from_acid.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/insert_nonacid_from_acid.q?rev=1637419&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/insert_nonacid_from_acid.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/insert_nonacid_from_acid.q Fri Nov 7 17:40:30 2014
@@ -0,0 +1,13 @@
+set hive.support.concurrency=true;
+set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+set hive.enforce.bucketing=true;
+
+-- This test checks that selecting from an acid table and inserting into a non-acid table works.
+create table sample_06(name varchar(50), age int, gpa decimal(3, 2)) clustered by (age) into 2 buckets stored as orc TBLPROPERTIES ("transactional"="true");
+insert into table sample_06 values ('aaa', 35, 3.00), ('bbb', 32, 3.00), ('ccc', 32, 3.00), ('ddd', 35, 3.00), ('eee', 32, 3.00);
+select * from sample_06 where gpa = 3.00;
+
+create table tab1 (name varchar(50), age int, gpa decimal(3, 2));
+insert into table tab1 select * from sample_06 where gpa = 3.00;
+select * from tab1;
+

Added: hive/trunk/ql/src/test/results/clientpositive/acid_join.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/acid_join.q.out?rev=1637419&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/acid_join.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/acid_join.q.out Fri Nov 7 17:40:30 2014
@@ -0,0 +1,72 @@
+PREHOOK: query: -- This test checks that a join with tables with two different buckets send the right bucket info to each table.
+create table acidjoin1(name varchar(50), age int) clustered by (age) into 2 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@acidjoin1
+POSTHOOK: query: -- This test checks that a join with tables with two different buckets send the right bucket info to each table.
+create table acidjoin1(name varchar(50), age int) clustered by (age) into 2 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@acidjoin1
+PREHOOK: query: create table acidjoin2(name varchar(50), gpa decimal(3, 2)) clustered by (gpa) into 4 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@acidjoin2
+POSTHOOK: query: create table acidjoin2(name varchar(50), gpa decimal(3, 2)) clustered by (gpa) into 4 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@acidjoin2
+PREHOOK: query: create table acidjoin3(name varchar(50), age int, gpa decimal(3, 2)) clustered by (gpa) into 8 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@acidjoin3
+POSTHOOK: query: create table acidjoin3(name varchar(50), age int, gpa decimal(3, 2)) clustered by (gpa) into 8 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@acidjoin3
+PREHOOK: query: insert into table acidjoin1 values ('aaa', 35), ('bbb', 32), ('ccc', 32), ('ddd', 35), ('eee', 32)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__1
+PREHOOK: Output: default@acidjoin1
+POSTHOOK: query: insert into table acidjoin1 values ('aaa', 35), ('bbb', 32), ('ccc', 32), ('ddd', 35), ('eee', 32)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__1
+POSTHOOK: Output: default@acidjoin1
+POSTHOOK: Lineage: acidjoin1.age EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col2, type:string, comment:), ]
+POSTHOOK: Lineage: acidjoin1.name EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+PREHOOK: query: insert into table acidjoin2 values ('aaa', 3.00), ('bbb', 3.01), ('ccc', 3.02), ('ddd', 3.03), ('eee', 3.04)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__2
+PREHOOK: Output: default@acidjoin2
+POSTHOOK: query: insert into table acidjoin2 values ('aaa', 3.00), ('bbb', 3.01), ('ccc', 3.02), ('ddd', 3.03), ('eee', 3.04)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__2
+POSTHOOK: Output: default@acidjoin2
+POSTHOOK: Lineage: acidjoin2.gpa EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, type:string, comment:), ]
+POSTHOOK: Lineage: acidjoin2.name EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+PREHOOK: query: insert into table acidjoin3 select a.name, age, gpa from acidjoin1 a join acidjoin2 b on (a.name = b.name)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@acidjoin1
+PREHOOK: Input: default@acidjoin2
+PREHOOK: Output: default@acidjoin3
+POSTHOOK: query: insert into table acidjoin3 select a.name, age, gpa from acidjoin1 a join acidjoin2 b on (a.name = b.name)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@acidjoin1
+POSTHOOK: Input: default@acidjoin2
+POSTHOOK: Output: default@acidjoin3
+POSTHOOK: Lineage: acidjoin3.age SIMPLE [(acidjoin1)a.FieldSchema(name:age, type:int, comment:null), ]
+POSTHOOK: Lineage: acidjoin3.gpa SIMPLE [(acidjoin2)b.FieldSchema(name:gpa, type:decimal(3,2), comment:null), ]
+POSTHOOK: Lineage: acidjoin3.name SIMPLE [(acidjoin1)a.FieldSchema(name:name, type:varchar(50), comment:null), ]
+PREHOOK: query: select * from acidjoin3 order by name
+PREHOOK: type: QUERY
+PREHOOK: Input: default@acidjoin3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from acidjoin3 order by name
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@acidjoin3
+#### A masked pattern was here ####
+aaa 35 3.00
+bbb 32 3.01
+ccc 32 3.02
+ddd 35 3.03
+eee 32 3.04

Added: hive/trunk/ql/src/test/results/clientpositive/insert_nonacid_from_acid.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/insert_nonacid_from_acid.q.out?rev=1637419&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/insert_nonacid_from_acid.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/insert_nonacid_from_acid.q.out Fri Nov 7 17:40:30 2014
@@ -0,0 +1,66 @@
+PREHOOK: query: -- This test checks that selecting from an acid table and inserting into a non-acid table works.
+create table sample_06(name varchar(50), age int, gpa decimal(3, 2)) clustered by (age) into 2 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@sample_06
+POSTHOOK: query: -- This test checks that selecting from an acid table and inserting into a non-acid table works.
+create table sample_06(name varchar(50), age int, gpa decimal(3, 2)) clustered by (age) into 2 buckets stored as orc TBLPROPERTIES ("transactional"="true")
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@sample_06
+PREHOOK: query: insert into table sample_06 values ('aaa', 35, 3.00), ('bbb', 32, 3.00), ('ccc', 32, 3.00), ('ddd', 35, 3.00), ('eee', 32, 3.00)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__1
+PREHOOK: Output: default@sample_06
+POSTHOOK: query: insert into table sample_06 values ('aaa', 35, 3.00), ('bbb', 32, 3.00), ('ccc', 32, 3.00), ('ddd', 35, 3.00), ('eee', 32, 3.00)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__1
+POSTHOOK: Output: default@sample_06
+POSTHOOK: Lineage: sample_06.age EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col2, type:string, comment:), ]
+POSTHOOK: Lineage: sample_06.gpa EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col3, type:string, comment:), ]
+POSTHOOK: Lineage: sample_06.name EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+PREHOOK: query: select * from sample_06 where gpa = 3.00
+PREHOOK: type: QUERY
+PREHOOK: Input: default@sample_06
+#### A masked pattern was here ####
+POSTHOOK: query: select * from sample_06 where gpa = 3.00
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@sample_06
+#### A masked pattern was here ####
+eee 32 3.00
+ccc 32 3.00
+bbb 32 3.00
+ddd 35 3.00
+aaa 35 3.00
+PREHOOK: query: create table tab1 (name varchar(50), age int, gpa decimal(3, 2))
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@tab1
+POSTHOOK: query: create table tab1 (name varchar(50), age int, gpa decimal(3, 2))
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@tab1
+PREHOOK: query: insert into table tab1 select * from sample_06 where gpa = 3.00
+PREHOOK: type: QUERY
+PREHOOK: Input: default@sample_06
+PREHOOK: Output: default@tab1
+POSTHOOK: query: insert into table tab1 select * from sample_06 where gpa = 3.00
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@sample_06
+POSTHOOK: Output: default@tab1
+POSTHOOK: Lineage: tab1.age SIMPLE [(sample_06)sample_06.FieldSchema(name:age, type:int, comment:null), ]
+POSTHOOK: Lineage: tab1.gpa SIMPLE [(sample_06)sample_06.FieldSchema(name:gpa, type:decimal(3,2), comment:null), ]
+POSTHOOK: Lineage: tab1.name SIMPLE [(sample_06)sample_06.FieldSchema(name:name, type:varchar(50), comment:null), ]
+PREHOOK: query: select * from tab1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@tab1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from tab1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@tab1
+#### A masked pattern was here ####
+eee 32 3.00
+ccc 32 3.00
+bbb 32 3.00
+ddd 35 3.00
+aaa 35 3.00

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedNov 7, '14 at 5:41p
activeNov 7, '14 at 5:41p
posts1
users1
websitehive.apache.org

1 user in discussion

Gates: 1 post

People

Translate

site design / logo © 2021 Grokbase