Skip to content

Commit 1ff14a2

Browse files
Thomas Poeppingashutoshc
Thomas Poepping
authored andcommitted
HIVE-16288 : Add blobstore tests for ORC and RCFILE file formats (Thomas Poepping via Ashutosh Chauhan)
Signed-off-by: Ashutosh Chauhan <[email protected]>
1 parent e222a07 commit 1ff14a2

17 files changed

+3006
-0
lines changed

files/events.txt

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
1111,20121121,1111,1,type1,eventData,session,full_uid,20121121,39,hq_change
2+
1111,20121121,1111,2,type1,eventData,session,full_uid,20121121,39,hq_change
3+
1111,20121121,1111,3,type1,eventData,session,full_uid,20121121,39,hq_change
4+
1111,20121121,1111,4,type1,eventData,session,full_uid,20121121,39,hq_change
5+
1111,20121121,1111,5,type1,eventData,session,full_uid,20121121,39,hq_change
6+
1111,20121121,1111,6,type1,eventData,session,full_uid,20121121,39,hq_change
7+
1111,20121121,1111,7,type1,eventData,session,full_uid,20121121,39,hq_change
8+
1111,20121121,1111,8,type1,eventData,session,full_uid,20121121,39,hq_change
9+
1111,20121121,1111,9,type1,eventData,session,full_uid,20121121,39,hq_change
10+
1111,20121121,1111,10,type1,eventData,session,full_uid,20121121,39,hq_change
11+
1111,20121121,1111,11,type1,eventData,session,full_uid,20121121,39,hq_change
12+
1111,20121121,1111,12,type1,eventData,session,full_uid,20121121,39,hq_change
13+
1111,20121121,1111,13,type1,eventData,session,full_uid,20121121,39,hq_change
14+
1111,20121121,1111,14,type1,eventData,session,full_uid,20121121,39,hq_change
15+
1111,20121121,1111,15,type1,eventData,session,full_uid,20121121,39,hq_change
16+
1111,20121121,1111,16,type1,eventData,session,full_uid,20121121,39,hq_change
17+
1111,20121121,1111,17,type1,eventData,session,full_uid,20121121,39,hq_change
18+
1111,20121121,1111,18,type1,eventData,session,full_uid,20121121,39,hq_change
19+
1111,20121121,1111,19,type1,eventData,session,full_uid,20121121,39,hq_change
20+
1111,20121121,1111,20,type1,eventData,session,full_uid,20121121,39,hq_change
21+
1111,20121121,1111,21,type1,eventData,session,full_uid,20121121,39,hq_change
22+
1111,20121121,1111,22,type1,eventData,session,full_uid,20121121,39,hq_change
23+
1111,20121121,1111,23,type1,eventData,session,full_uid,20121121,39,hq_change
24+
1111,20121121,1111,24,type1,eventData,session,full_uid,20121121,39,hq_change
25+
1111,20121121,1111,25,type1,eventData,session,full_uid,20121121,39,hq_change
26+
1111,20121121,1111,26,type1,eventData,session,full_uid,20121121,39,hq_change
27+
1111,20121121,1111,27,type1,eventData,session,full_uid,20121121,39,hq_change
28+
1111,20121121,1111,28,type1,eventData,session,full_uid,20121121,39,hq_change
29+
1111,20121121,1111,29,type1,eventData,session,full_uid,20121121,39,hq_change
30+
1111,20121121,1111,30,type1,eventData,session,full_uid,20121121,39,hq_change
31+
1111,20121121,1111,31,type1,eventData,session,full_uid,20121121,39,hq_change
32+
1111,20121121,1111,32,type1,eventData,session,full_uid,20121121,39,hq_change
33+
1111,20121121,1111,33,type1,eventData,session,full_uid,20121121,39,hq_change
34+
1111,20121121,1111,34,type1,eventData,session,full_uid,20121121,39,hq_change
35+
1111,20121121,1111,35,type1,eventData,session,full_uid,20121121,39,hq_change
36+
1111,20121121,1111,36,type1,eventData,session,full_uid,20121121,39,hq_change
37+
1111,20121121,1111,37,type1,eventData,session,full_uid,20121121,39,hq_change
38+
1111,20121121,1111,38,type1,eventData,session,full_uid,20121121,39,hq_change
39+
1111,20121121,1111,39,type1,eventData,session,full_uid,20121121,39,hq_change
40+
1111,20121121,1111,40,type1,eventData,session,full_uid,20121121,39,hq_change
41+
1111,20121121,1111,41,type1,eventData,session,full_uid,20121121,39,hq_change
42+
1111,20121121,1111,42,type1,eventData,session,full_uid,20121121,39,hq_change
43+
1111,20121121,1111,43,type1,eventData,session,full_uid,20121121,39,hq_change
44+
1111,20121121,1111,44,type1,eventData,session,full_uid,20121121,39,hq_change
45+
1111,20121121,1111,45,type1,eventData,session,full_uid,20121121,39,hq_change
46+
1111,20121121,1111,46,type1,eventData,session,full_uid,20121121,39,hq_change
47+
1111,20121121,1111,47,type1,eventData,session,full_uid,20121121,39,hq_change
48+
1111,20121121,1111,48,type1,eventData,session,full_uid,20121121,39,hq_change
49+
1111,20121121,1111,49,type1,eventData,session,full_uid,20121121,39,hq_change
50+
1111,20121121,1111,50,type1,eventData,session,full_uid,20121121,39,hq_change
51+
1111,20121021,1111,1,type1,eventData,session,full_uid,20121021,39,hq_change
52+
1111,20121021,1111,2,type1,eventData,session,full_uid,20121021,39,hq_change
53+
1111,20121021,1111,3,type1,eventData,session,full_uid,20121021,39,hq_change
54+
1111,20121021,1111,4,type1,eventData,session,full_uid,20121021,39,hq_change
55+
1111,20121021,1111,5,type1,eventData,session,full_uid,20121021,39,hq_change
56+
1111,20121021,1111,6,type1,eventData,session,full_uid,20121021,39,hq_change
57+
1111,20121021,1111,7,type1,eventData,session,full_uid,20121021,39,hq_change
58+
1111,20121021,1111,8,type1,eventData,session,full_uid,20121021,39,hq_change
59+
1111,20121021,1111,9,type1,eventData,session,full_uid,20121021,39,hq_change
60+
1111,20121021,1111,10,type1,eventData,session,full_uid,20121021,39,hq_change
61+
1111,20121021,1111,11,type1,eventData,session,full_uid,20121021,39,hq_change
62+
1111,20121021,1111,12,type1,eventData,session,full_uid,20121021,39,hq_change
63+
1111,20121021,1111,13,type1,eventData,session,full_uid,20121021,39,hq_change
64+
1111,20121021,1111,14,type1,eventData,session,full_uid,20121021,39,hq_change
65+
1111,20121021,1111,15,type1,eventData,session,full_uid,20121021,39,hq_change
66+
1111,20121021,1111,16,type1,eventData,session,full_uid,20121021,39,hq_change
67+
1111,20121021,1111,17,type1,eventData,session,full_uid,20121021,39,hq_change
68+
1111,20121021,1111,18,type1,eventData,session,full_uid,20121021,39,hq_change
69+
1111,20121021,1111,19,type1,eventData,session,full_uid,20121021,39,hq_change
70+
1111,20121021,1111,20,type1,eventData,session,full_uid,20121021,39,hq_change
71+
1111,20121021,1111,21,type1,eventData,session,full_uid,20121021,39,hq_change
72+
1111,20121021,1111,22,type1,eventData,session,full_uid,20121021,39,hq_change
73+
1111,20121021,1111,23,type1,eventData,session,full_uid,20121021,39,hq_change
74+
1111,20121021,1111,24,type1,eventData,session,full_uid,20121021,39,hq_change
75+
1111,20121021,1111,25,type1,eventData,session,full_uid,20121021,39,hq_change
76+
1111,20121021,1111,26,type1,eventData,session,full_uid,20121021,39,hq_change
77+
1111,20121021,1111,27,type1,eventData,session,full_uid,20121021,39,hq_change
78+
1111,20121021,1111,28,type1,eventData,session,full_uid,20121021,39,hq_change
79+
1111,20121021,1111,29,type1,eventData,session,full_uid,20121021,39,hq_change
80+
1111,20121021,1111,30,type1,eventData,session,full_uid,20121021,39,hq_change
81+
1111,20121021,1111,31,type1,eventData,session,full_uid,20121021,39,hq_change
82+
1111,20121021,1111,32,type1,eventData,session,full_uid,20121021,39,hq_change
83+
1111,20121021,1111,33,type1,eventData,session,full_uid,20121021,39,hq_change
84+
1111,20121021,1111,34,type1,eventData,session,full_uid,20121021,39,hq_change
85+
1111,20121021,1111,35,type1,eventData,session,full_uid,20121021,39,hq_change
86+
1111,20121021,1111,36,type1,eventData,session,full_uid,20121021,39,hq_change
87+
1111,20121021,1111,37,type1,eventData,session,full_uid,20121021,39,hq_change
88+
1111,20121021,1111,38,type1,eventData,session,full_uid,20121021,39,hq_change
89+
1111,20121021,1111,39,type1,eventData,session,full_uid,20121021,39,hq_change
90+
1111,20121021,1111,40,type1,eventData,session,full_uid,20121021,39,hq_change
91+
1111,20121021,1111,41,type1,eventData,session,full_uid,20121021,39,hq_change
92+
1111,20121021,1111,42,type1,eventData,session,full_uid,20121021,39,hq_change
93+
1111,20121021,1111,43,type1,eventData,session,full_uid,20121021,39,hq_change
94+
1111,20121021,1111,44,type1,eventData,session,full_uid,20121021,39,hq_change
95+
1111,20121021,1111,45,type1,eventData,session,full_uid,20121021,39,hq_change
96+
1111,20121021,1111,46,type1,eventData,session,full_uid,20121021,39,hq_change
97+
1111,20121021,1111,47,type1,eventData,session,full_uid,20121021,39,hq_change
98+
1111,20121021,1111,48,type1,eventData,session,full_uid,20121021,39,hq_change
99+
1111,20121021,1111,49,type1,eventData,session,full_uid,20121021,39,hq_change
100+
1111,20121021,1111,50,type1,eventData,session,full_uid,20121021,39,hq_change
101+
1111,20121221,1111,1,type1,eventData,session,full_uid,20121121,39,hq_change
102+
1111,20121221,1111,2,type1,eventData,session,full_uid,20121121,39,hq_change
103+
1111,20121221,1111,3,type1,eventData,session,full_uid,20121121,39,hq_change
104+
1111,20121221,1111,4,type1,eventData,session,full_uid,20121121,39,hq_change
105+
1111,20121221,1111,5,type1,eventData,session,full_uid,20121121,39,hq_change
106+
1111,20121221,1111,6,type1,eventData,session,full_uid,20121121,39,hq_change
107+
1111,20121221,1111,7,type1,eventData,session,full_uid,20121121,39,hq_change
108+
1111,20121221,1111,8,type1,eventData,session,full_uid,20121121,39,hq_change
109+
1111,20121221,1111,9,type1,eventData,session,full_uid,20121121,39,hq_change
110+
1111,20121221,1111,10,type1,eventData,session,full_uid,20121121,39,hq_change
111+
1111,20121221,1111,11,type1,eventData,session,full_uid,20121121,39,hq_change
112+
1111,20121221,1111,12,type1,eventData,session,full_uid,20121121,39,hq_change
113+
1111,20121221,1111,13,type1,eventData,session,full_uid,20121121,39,hq_change
114+
1111,20121221,1111,14,type1,eventData,session,full_uid,20121121,39,hq_change
115+
1111,20121221,1111,15,type1,eventData,session,full_uid,20121121,39,hq_change
116+
1111,20121221,1111,16,type1,eventData,session,full_uid,20121121,39,hq_change
117+
1111,20121221,1111,17,type1,eventData,session,full_uid,20121121,39,hq_change
118+
1111,20121221,1111,18,type1,eventData,session,full_uid,20121121,39,hq_change
119+
1111,20121221,1111,19,type1,eventData,session,full_uid,20121121,39,hq_change
120+
1111,20121221,1111,20,type1,eventData,session,full_uid,20121121,39,hq_change
121+
1111,20121221,1111,21,type1,eventData,session,full_uid,20121121,39,hq_change
122+
1111,20121221,1111,22,type1,eventData,session,full_uid,20121121,39,hq_change
123+
1111,20121221,1111,23,type1,eventData,session,full_uid,20121121,39,hq_change
124+
1111,20121221,1111,24,type1,eventData,session,full_uid,20121121,39,hq_change
125+
1111,20121221,1111,25,type1,eventData,session,full_uid,20121121,39,hq_change
126+
1111,20121221,1111,26,type1,eventData,session,full_uid,20121121,39,hq_change
127+
1111,20121221,1111,27,type1,eventData,session,full_uid,20121121,39,hq_change
128+
1111,20121221,1111,28,type1,eventData,session,full_uid,20121121,39,hq_change
129+
1111,20121221,1111,29,type1,eventData,session,full_uid,20121121,39,hq_change
130+
1111,20121221,1111,30,type1,eventData,session,full_uid,20121121,39,hq_change
131+
1111,20121221,1111,31,type1,eventData,session,full_uid,20121121,39,hq_change
132+
1111,20121221,1111,32,type1,eventData,session,full_uid,20121121,39,hq_change
133+
1111,20121221,1111,33,type1,eventData,session,full_uid,20121121,39,hq_change
134+
1111,20121221,1111,34,type1,eventData,session,full_uid,20121121,39,hq_change
135+
1111,20121221,1111,35,type1,eventData,session,full_uid,20121121,39,hq_change
136+
1111,20121221,1111,36,type1,eventData,session,full_uid,20121121,39,hq_change
137+
1111,20121221,1111,37,type1,eventData,session,full_uid,20121121,39,hq_change
138+
1111,20121221,1111,38,type1,eventData,session,full_uid,20121121,39,hq_change
139+
1111,20121221,1111,39,type1,eventData,session,full_uid,20121121,39,hq_change
140+
1111,20121221,1111,40,type1,eventData,session,full_uid,20121121,39,hq_change
141+
1111,20121221,1111,41,type1,eventData,session,full_uid,20121121,39,hq_change
142+
1111,20121221,1111,42,type1,eventData,session,full_uid,20121121,39,hq_change
143+
1111,20121221,1111,43,type1,eventData,session,full_uid,20121121,39,hq_change
144+
1111,20121221,1111,44,type1,eventData,session,full_uid,20121121,39,hq_change
145+
1111,20121221,1111,45,type1,eventData,session,full_uid,20121121,39,hq_change
146+
1111,20121221,1111,46,type1,eventData,session,full_uid,20121121,39,hq_change
147+
1111,20121221,1111,47,type1,eventData,session,full_uid,20121121,39,hq_change
148+
1111,20121221,1111,48,type1,eventData,session,full_uid,20121121,39,hq_change
149+
1111,20121221,1111,49,type1,eventData,session,full_uid,20121121,39,hq_change
150+
1111,20121221,1111,50,type1,eventData,session,full_uid,20121121,39,hq_change
151+
1111,20120921,1111,1,type1,eventData,session,full_uid,20120921,39,hq_change
152+
1111,20120921,1111,2,type1,eventData,session,full_uid,20120921,39,hq_change
153+
1111,20120921,1111,3,type1,eventData,session,full_uid,20120921,39,hq_change
154+
1111,20120921,1111,4,type1,eventData,session,full_uid,20120921,39,hq_change
155+
1111,20120921,1111,5,type1,eventData,session,full_uid,20120921,39,hq_change
156+
1111,20120921,1111,6,type1,eventData,session,full_uid,20120921,39,hq_change
157+
1111,20120921,1111,7,type1,eventData,session,full_uid,20120921,39,hq_change
158+
1111,20120921,1111,8,type1,eventData,session,full_uid,20120921,39,hq_change
159+
1111,20120921,1111,9,type1,eventData,session,full_uid,20120921,39,hq_change
160+
1111,20120921,1111,10,type1,eventData,session,full_uid,20120921,39,hq_change
161+
1111,20120921,1111,11,type1,eventData,session,full_uid,20120921,39,hq_change
162+
1111,20120921,1111,12,type1,eventData,session,full_uid,20120921,39,hq_change
163+
1111,20120921,1111,13,type1,eventData,session,full_uid,20120921,39,hq_change
164+
1111,20120921,1111,14,type1,eventData,session,full_uid,20120921,39,hq_change
165+
1111,20120921,1111,15,type1,eventData,session,full_uid,20120921,39,hq_change
166+
1111,20120921,1111,16,type1,eventData,session,full_uid,20120921,39,hq_change
167+
1111,20120921,1111,17,type1,eventData,session,full_uid,20120921,39,hq_change
168+
1111,20120921,1111,18,type1,eventData,session,full_uid,20120921,39,hq_change
169+
1111,20120921,1111,19,type1,eventData,session,full_uid,20120921,39,hq_change
170+
1111,20120921,1111,20,type1,eventData,session,full_uid,20120921,39,hq_change
171+
1111,20120921,1111,21,type1,eventData,session,full_uid,20120921,39,hq_change
172+
1111,20120921,1111,22,type1,eventData,session,full_uid,20120921,39,hq_change
173+
1111,20120921,1111,23,type1,eventData,session,full_uid,20120921,39,hq_change
174+
1111,20120921,1111,24,type1,eventData,session,full_uid,20120921,39,hq_change
175+
1111,20120921,1111,25,type1,eventData,session,full_uid,20120921,39,hq_change
176+
1111,20120921,1111,26,type1,eventData,session,full_uid,20120921,39,hq_change
177+
1111,20120921,1111,27,type1,eventData,session,full_uid,20120921,39,hq_change
178+
1111,20120921,1111,28,type1,eventData,session,full_uid,20120921,39,hq_change
179+
1111,20120921,1111,29,type1,eventData,session,full_uid,20120921,39,hq_change
180+
1111,20120921,1111,30,type1,eventData,session,full_uid,20120921,39,hq_change
181+
1111,20120921,1111,31,type1,eventData,session,full_uid,20120921,39,hq_change
182+
1111,20120921,1111,32,type1,eventData,session,full_uid,20120921,39,hq_change
183+
1111,20120921,1111,33,type1,eventData,session,full_uid,20120921,39,hq_change
184+
1111,20120921,1111,34,type1,eventData,session,full_uid,20120921,39,hq_change
185+
1111,20120921,1111,35,type1,eventData,session,full_uid,20120921,39,hq_change
186+
1111,20120921,1111,36,type1,eventData,session,full_uid,20120921,39,hq_change
187+
1111,20120921,1111,37,type1,eventData,session,full_uid,20120921,39,hq_change
188+
1111,20120921,1111,38,type1,eventData,session,full_uid,20120921,39,hq_change
189+
1111,20120921,1111,39,type1,eventData,session,full_uid,20120921,39,hq_change
190+
1111,20120921,1111,40,type1,eventData,session,full_uid,20120921,39,hq_change
191+
1111,20120921,1111,41,type1,eventData,session,full_uid,20120921,39,hq_change
192+
1111,20120921,1111,42,type1,eventData,session,full_uid,20120921,39,hq_change
193+
1111,20120921,1111,43,type1,eventData,session,full_uid,20120921,39,hq_change
194+
1111,20120921,1111,44,type1,eventData,session,full_uid,20120921,39,hq_change
195+
1111,20120921,1111,45,type1,eventData,session,full_uid,20120921,39,hq_change
196+
1111,20120921,1111,46,type1,eventData,session,full_uid,20120921,39,hq_change
197+
1111,20120921,1111,47,type1,eventData,session,full_uid,20120921,39,hq_change
198+
1111,20120921,1111,48,type1,eventData,session,full_uid,20120921,39,hq_change
199+
1111,20120921,1111,49,type1,eventData,session,full_uid,20120921,39,hq_change
200+
1111,20120921,1111,50,type1,eventData,session,full_uid,20120921,39,hq_change
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
-- Test simple interaction with partitioned bucketed table with orc format in blobstore
2+
3+
SET hive.exec.dynamic.partition=true;
4+
SET hive.exec.reducers.max=10;
5+
SET hive.exec.dynamic.partition.mode=nonstrict;
6+
7+
DROP TABLE blobstore_source;
8+
CREATE TABLE blobstore_source(a STRING, b STRING, c DOUBLE)
9+
ROW FORMAT DELIMITED
10+
FIELDS TERMINATED BY ' '
11+
COLLECTION ITEMS TERMINATED BY '\t'
12+
LINES TERMINATED BY '\n'
13+
LOCATION '${hiveconf:test.blobstore.path.unique}/orc_buckets/blobstore_source/';
14+
LOAD DATA LOCAL INPATH '../../data/files/3col_data.txt' INTO TABLE blobstore_source;
15+
16+
DROP TABLE orc_buckets;
17+
CREATE TABLE orc_buckets (a STRING, value DOUBLE)
18+
PARTITIONED BY (b STRING)
19+
CLUSTERED BY (a) INTO 10 BUCKETS
20+
STORED AS ORC
21+
LOCATION '${hiveconf:test.blobstore.path.unique}/orc_buckets/orc_buckets';
22+
23+
INSERT OVERWRITE TABLE orc_buckets
24+
PARTITION (b)
25+
SELECT a, c, b FROM blobstore_source;
26+
SELECT * FROM orc_buckets;
27+
28+
INSERT INTO TABLE orc_buckets
29+
PARTITION (b)
30+
SELECT a, c, b FROM blobstore_source;
31+
SELECT * FROM orc_buckets;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- Test INSERT OVERWRITE and INSERT INTO on orc table in blobstore
2+
3+
DROP TABLE blobstore_source;
4+
CREATE TABLE blobstore_source(a STRING, b STRING, c DOUBLE)
5+
ROW FORMAT DELIMITED
6+
FIELDS TERMINATED BY ' '
7+
COLLECTION ITEMS TERMINATED BY '\t'
8+
LINES TERMINATED BY '\n'
9+
LOCATION '${hiveconf:test.blobstore.path.unique}/orc_format_nonpart/blobstore_source/';
10+
LOAD DATA LOCAL INPATH '../../data/files/3col_data.txt' INTO TABLE blobstore_source;
11+
12+
DROP TABLE orc_table;
13+
CREATE EXTERNAL TABLE orc_table (a INT, b STRING, value DOUBLE) STORED AS ORC
14+
LOCATION '${hiveconf:test.blobstore.path.unique}/orc_format_nonpart/orc_table';
15+
16+
INSERT OVERWRITE TABLE orc_table
17+
SELECT * FROM blobstore_source;
18+
19+
SELECT * FROM orc_table;
20+
SELECT a FROM orc_table GROUP BY a;
21+
SELECT b FROM orc_table GROUP BY b;
22+
SELECT value FROM orc_table GROUP BY value;
23+
24+
INSERT INTO TABLE orc_table
25+
SELECT * FROM blobstore_source;
26+
27+
SELECT * FROM orc_table;
28+
SELECT a FROM orc_table GROUP BY a;
29+
SELECT b FROM orc_table GROUP BY b;
30+
SELECT value FROM orc_table GROUP BY value;
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
-- Test INSERT INTO and INSERT OVERWRITE on partitioned orc table in blobstore
2+
3+
DROP TABLE src_events;
4+
CREATE TABLE src_events
5+
(
6+
log_id BIGINT,
7+
time BIGINT,
8+
uid BIGINT,
9+
user_id BIGINT,
10+
type INT,
11+
event_data STRING,
12+
session_id STRING,
13+
full_uid BIGINT,
14+
run_date STRING,
15+
game_id INT,
16+
event_name STRING
17+
)
18+
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
19+
LOCATION '${hiveconf:test.blobstore.path.unique}/orc_format_part/src_events/';
20+
LOAD DATA LOCAL INPATH '../../data/files/events.txt' INTO TABLE src_events;
21+
22+
DROP TABLE orc_events;
23+
CREATE TABLE orc_events
24+
(
25+
log_id BIGINT,
26+
time BIGINT,
27+
uid BIGINT,
28+
user_id BIGINT,
29+
type INT,
30+
event_data STRING,
31+
session_id STRING,
32+
full_uid BIGINT
33+
)
34+
PARTITIONED BY (run_date STRING, game_id INT, event_name STRING)
35+
STORED AS ORC
36+
LOCATION '${hiveconf:test.blobstore.path.unique}/orc_format_part/orc_events';
37+
38+
SET hive.exec.dynamic.partition=true;
39+
SET hive.exec.dynamic.partition.mode=nonstrict;
40+
41+
INSERT OVERWRITE TABLE orc_events PARTITION (run_date, game_id, event_name)
42+
SELECT * FROM src_events;
43+
SHOW PARTITIONS orc_events;
44+
SELECT COUNT(*) FROM orc_events;
45+
SELECT COUNT(*) FROM orc_events WHERE run_date=20120921;
46+
SELECT COUNT(*) FROM orc_events WHERE run_date=20121121;
47+
48+
INSERT OVERWRITE TABLE orc_events PARTITION (run_date=201211, game_id, event_name)
49+
SELECT log_id,time,uid,user_id,type,event_data,session_id,full_uid,game_id,event_name FROM src_events
50+
WHERE SUBSTR(run_date,1,6)='201211';
51+
SHOW PARTITIONS orc_events;
52+
SELECT COUNT(*) FROM orc_events;
53+
54+
INSERT INTO TABLE orc_events PARTITION (run_date=201209, game_id=39, event_name)
55+
SELECT log_id,time,uid,user_id,type,event_data,session_id,full_uid,event_name FROM src_events
56+
WHERE SUBSTR(run_date,1,6)='201209' AND game_id=39;
57+
SELECT COUNT(*) FROM orc_events;
58+
59+
INSERT INTO TABLE orc_events PARTITION (run_date=201209, game_id=39, event_name='hq_change')
60+
SELECT log_id,time,uid,user_id,type,event_data,session_id,full_uid FROM src_events
61+
WHERE SUBSTR(run_date,1,6)='201209' AND game_id=39 AND event_name='hq_change';
62+
SELECT COUNT(*) FROM orc_events;
63+
64+
INSERT OVERWRITE TABLE orc_events PARTITION (run_date=201209, game_id=39, event_name='hq_change')
65+
SELECT log_id,time,uid,user_id,type,event_data,session_id,full_uid FROM src_events
66+
WHERE SUBSTR(run_date,1,6)='201209' AND game_id=39 AND event_name='hq_change';
67+
SELECT COUNT(*) FROM orc_events;

0 commit comments

Comments
 (0)