-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkey
578 lines (546 loc) · 17.3 KB
/
key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
!connect jdbc:hive2://ec2-52-207-2-108.compute-1.amazonaws.com:10000/default;principal=hive/[email protected];
--2003 and 2004 table
CREATE TABLE airtrafficlanding
(
Year int,
Month int,
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNum int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/airtraffic_yearly_internal'
TBLPROPERTIES ('skip.header.line.count'='1');
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp --query "select * from airtraffic_control where Year=2003 and \$CONDITIONS" --split-by Year --m 1 --delete-target-dir --target-dir /user/daniel/project/sqoop/airtraffic_yearly_internal
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp --query "select * from airtraffic_control where Year=2004 and \$CONDITIONS" --split-by Year --m 1 --incremental append --check-column Year --target-dir /user/daniel/project/sqoop/airtraffic_yearly_internal
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp --query "select * from airtraffic_control where Year=2005 and \$CONDITIONS" --split-by Year --m 1 --target-dir /user/daniel/project/sqoop/airtraffic_yearly_2005
load data inpath '/user/daniel/project/sqoop/airtraffic_yearly_internal/part-m-*' into table airtrafficlanding;
CREATE TABLE IF NOT EXISTS airtraffic_yearly_internal
(
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNumber int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
PARTITIONED BY
(
year int,
month int
)
CLUSTERED BY (DayofMonth) INTO 15 BUCKETS
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS PARQUET
LOCATION '/user/daniel/project/airtraffic_yearly_internal/'
TBLPROPERTIES ('PARQEUT.COMPRESS'='SNAPPY');
SET hive.exec.dynamic.partition=true;
SET hive.exec.dynamic.partition.mode=nonstrict;
set hive.enforce.bucketing = true;
INSERT OVERWRITE TABLE airtraffic_yearly_internal PARTITION(Year, Month)
SELECT DayofMonth, DayOfWeek, DepTime, CRSDepTime, ArrTime, CRSArrTime, UniqueCarrier, FlightNum, TailNum,
ActualElapsedTime, CRSElapsedTime, AirTime, ArrDelay, DepDelay, Origin, Dest, Distance, TaxiIn, TaxiOut,
Cancelled, CancellationCode, Diverted, CarrierDelay, WeatherDelay, NASDelay, SecurityDelay, LateAircraftDelay, Year, Month
FROM airtrafficlanding;
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp
--query "select Year,Month,DayofMonth,UniqueCarrier,FlightNum,TailNum,Origin,Dest,Cancelled,CancellationCode,TaxiIn,TaxiOut,Diverted from airtraffic_control where Year=2003 and \$CONDITIONS"
--split-by Year --m 2 --hbase-table airtraffic_yearly_hbase --column-family CF_AIRLINE
--hbase-row-key Year,Month,DayofMonth,FlightNum,TailNum
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp
--query "select Year,Month,DayofMonth,DayOfWeek,DepTime,CRSDepTime,ArrTime,CRSArrTime,FlightNum,TailNum,ActualElapsedTime,CRSElapsedTime,AirTime,ArrDelay,DepDelay,Distance from airtraffic_control where Year=2003 and \$CONDITIONS"
--split-by Year --m 2 --hbase-table airtraffic_yearly_hbase --column-family CF_TIME_AND_DISTANCE --hbase-row-key Year,Month,DayofMonth,FlightNum,TailNum
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp
--query "select Year,Month,DayofMonth,UniqueCarrier,FlightNum,TailNum,CarrierDelay,WeatherDelay,NASDelay,SecurityDelay,LateAircraftDelay from airtraffic_control where Year=2003 and \$CONDITIONS"
--split-by Year --m 2 --hbase-table airtraffic_yearly_hbase --column-family CF_WEATHER --hbase-row-key Year,Month,DayofMonth,FlightNum,TailNum
--Airport_1 and Carriers
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp --table airports_1 --m 1 --target-dir /user/daniel/project/sqoop/airport_1 --hive-import --create-hive-table --hive-table daniel_db:airport_1
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp --table carriers --m 1 --target-dir /user/daniel/project/sqoop/carriers --hive-import --create-hive-table --hive-table carriers
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_airport_1
(
iata string,
airport string,
city string,
state string,
country string,
lat decimal,
long decimal
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ''
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/sqoop/airports_1/';
LOad data inpath '/user/daniel/project/sqoop/airport_1/copy/part-m*' into table airtraffic_airport_1;
CREATE EXTERNAL TABLE airtraffic_carriers
(
code string,
description string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ''
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/sqoop/carriers';
hdfs dfs -mkdir /user/daniel/project/local_data
hdfs dfs -put /sollers/big_data_eng/airtraffic_control/datasets/facts/2006.csv /user/daniel/project/local_data
hdfs dfs -chmod 777 /user/daniel/project/local_data/2006.csv
CREATE TABLE airtrafficstaging_2006
(
Year int,
Month int,
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNum int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/local_data'
TBLPROPERTIES ('skip.header.line.count'='1');
load data inpath '/user/daniel/project/local_data/20*' into table airtrafficstaging_2006;
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_yearly_external
(
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNumber int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
PARTITIONED BY
(
year int,
month int
)
CLUSTERED BY (DayofMonth) INTO 15 BUCKETS
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS PARQUET
LOCATION '/user/daniel/project/airtraffic_yearly_external/'
TBLPROPERTIES ('PARQEUT.COMPRESS'='SNAPPY');
INSERT OVERWRITE TABLE airtraffic_yearly_external PARTITION(Year, Month) SELECT DayofMonth, DayOfWeek, DepTime, CRSDepTime, ArrTime, CRSArrTime, UniqueCarrier, FlightNum, TailNum, ActualElapsedTime, CRSElapsedTime, AirTime, ArrDelay, DepDelay, Origin, Dest, Distance, TaxiIn, TaxiOut, Cancelled, CancellationCode, Diverted, CarrierDelay, WeatherDelay, NASDelay, SecurityDelay, LateAircraftDelay, Year, Month FROM airtrafficstaging_2006;
hdfs dfs -put /sollers/big_data_eng/airtraffic_control/datasets/dimensions/airports_2.csv /user/daniel/project/local_data
hdfs dfs -put /sollers/big_data_eng/airtraffic_control/datasets/dimensions/plane-data.csv /user/daniel/project/local_data
iata,airport,city,state,country,lat,long
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_airport_2
(
iata string,
airport string,
city string,
state string,
country string,
lat decimal,
long decimal
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/local_data/airports_2/'
TBLPROPERTIES ('skip.header.line.count'='1');
tailnum,type,manufacturer,issue_date,model,status,aircraft_type,engine_type,year
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_plane_data
(
tailnum string,
type string,
manufacturer string,
issue_date string,
model string,
status string,
aircraft_type string,
engine_type string,
year int
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/local_data/plane-data/'
TBLPROPERTIES ('skip.header.line.count'='1');
//set hive.cli.print.header=true;
//INSERT OVERWRITE LOCAL DIRECTORY '/user/daniel/project/hbase'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
select * from airtraffic_yearly_internal WHERE Year=2004;
run command outside hbase shell (main linux line)
//org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.columns="HBASE_ROW_KEY,CF_AIRLINE:name,CF_TIME_AND_DISTANCE:movieName,CF_WEATHER:movieYear"
//daniel:airtraffic_yearly_hbase /user/movies/movies.tsv
--CLEANSING
insert overwrite table airtraffic_plane_data select distinct * from airtraffic_plane_data;
create table airtraffic_plane_data_tmp as select * from airtraffic_plane_data where manufacturer is not null;
//ALTER TABLE airtraffic_plane_data_tmp SET TBLPROPERTIES('serialization.null.format'='');
insert overwrite table airtraffic_plane_data select * from airtraffic_plane_data_tmp;
insert overwrite table airtraffic_carriers select * from airtraffic_carriers where LENGTH(code) < 4;
select regexp_replace(Description,'/','\-') from airtraffic_carriers;
//TRANFORMATION
CREATE TABLE IF NOT EXISTS airtraffic_plane_data_avro
(
tailnum string,
type string,
manufacturer string,
issue_date string,
model string,
status string,
aircraft_type string,
engine_type string,
year int
)
STORED AS AVRO;
INSERT OVERWRITE TABLE airtraffic_plane_data_avro SELECT * FROM airtraffic_plane_data;
add jar /sollers/big_data_eng/jars;--permissions error
--restart hive cluster to initiate jar file
create table airtraffic_airport as
select * from airtraffic_airport_1
union all
select * from airtraffic_airport_2;
//STAGING
INSERT OVERWRITE DIRECTORY '/user/daniel/project/staging/airtraffic_airport'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
select * from airtraffic_airport;
INSERT OVERWRITE DIRECTORY '/user/daniel/project/staging/airtraffic_yearly_internal'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS PARQUET
select * from airtraffic_yearly_internal;
INSERT OVERWRITE DIRECTORY '/user/daniel/project/staging/airtraffic_yearly_external'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS PARQUET
select * from airtraffic_yearly_external;
INSERT OVERWRITE DIRECTORY '/user/daniel/project/staging/airtraffic_plane_data'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
select * from airtraffic_plane_data_avro;
INSERT OVERWRITE DIRECTORY '/user/daniel/project/staging/airtraffic_carriers'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
select * from airtraffic_carriers;
--2005 sqoop import
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_yearly_2005
(
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNumber int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
PARTITIONED BY
(
year int,
month int
)
CLUSTERED BY (DayofMonth) INTO 15 BUCKETS
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS PARQUET
LOCATION '/user/daniel/project/sqoop/airtraffic_yearly_2005/'
TBLPROPERTIES ('PARQEUT.COMPRESS'='SNAPPY');
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_yearly_2005_staging
(
Year int,
Month int,
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNumber int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/sqoop/airtraffic_yearly_2005_staging/'
TBLPROPERTIES ('skip.header.line.count'='1');
sqoop import --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp --query "select * from airtraffic_control where Year=2005 and \$CONDITIONS" --split-by Year --m 1 --delete-target-dir --target-dir /user/daniel/project/sqoop/airtraffic_yearly_2005
load data inpath '/user/daniel/project/sqoop/airtraffic_yearly_2005/part-m-*' into table airtraffic_yearly_2005_staging;
INSERT OVERWRITE TABLE airtraffic_yearly_2005 PARTITION(Year, Month) SELECT DayofMonth, DayOfWeek, DepTime, CRSDepTime, ArrTime, CRSArrTime, UniqueCarrier, FlightNumber as FlightNum, TailNum, ActualElapsedTime, CRSElapsedTime, AirTime, ArrDelay, DepDelay, Origin, Dest, Distance, TaxiIn, TaxiOut, Cancelled, CancellationCode, Diverted, CarrierDelay, WeatherDelay, NASDelay, SecurityDelay, LateAircraftDelay, Year, Month FROM airtraffic_yearly_2005_staging;
--2003 to 2007
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_yearly
(
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNumber int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
PARTITIONED BY
(
year int,
month int
)
CLUSTERED BY (DayofMonth) INTO 15 BUCKETS
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS PARQUET
LOCATION '/user/daniel/project/sqoop/airtraffic_yearly'
TBLPROPERTIES ('PARQEUT.COMPRESS'='SNAPPY');
INSERT INTO TABLE airtraffic_yearly PARTITION(Year,Month) SELECT * FROM airtraffic_yearly_internal;
INSERT INTO TABLE airtraffic_yearly PARTITION(Year,Month) SELECT * FROM airtraffic_yearly_2005;
INSERT INTO TABLE airtraffic_yearly PARTITION(Year,Month) SELECT * FROM airtraffic_yearly_external;
INSERT INTO TABLE airtraffic_yearly PARTITION(Year,Month) SELECT * FROM airtraffic_yearly_2008;
Dropped the 2003 partition file in HDFS
Exchange partition option
--2008 data
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_yearly_2008
(
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNumber int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
PARTITIONED BY
(
year int,
month int
)
CLUSTERED BY (DayofMonth) INTO 15 BUCKETS
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS PARQUET
LOCATION '/user/daniel/project/sqoop/airtraffic_yearly_2008/'
TBLPROPERTIES ('PARQEUT.COMPRESS'='SNAPPY');
CREATE EXTERNAL TABLE IF NOT EXISTS airtraffic_yearly_2008_staging
(
Year int,
Month int,
DayofMonth int,
DayOfWeek int,
DepTime int,
CRSDepTime int,
ArrTime int,
CRSArrTime int,
UniqueCarrier string,
FlightNumber int,
TailNum string,
ActualElapsedTime int,
CRSElapsedTime int,
AirTime int,
ArrDelay int,
DepDelay int,
Origin string,
Dest string,
Distance int,
TaxiIn int,
TaxiOut int,
Cancelled int,
CancellationCode string,
Diverted int,
CarrierDelay int,
WeatherDelay int,
NASDelay int,
SecurityDelay int,
LateAircraftDelay int
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS TEXTFILE
LOCATION '/user/daniel/project/local_data/airtraffic_yearly_2008_staging'
TBLPROPERTIES ('skip.header.line.count'='1');
INSERT OVERWRITE TABLE airtraffic_yearly_2008 PARTITION(Year, Month) SELECT DayofMonth, DayOfWeek, DepTime, CRSDepTime, ArrTime, CRSArrTime, UniqueCarrier, FlightNumber as FlightNum, TailNum, ActualElapsedTime, CRSElapsedTime, AirTime, ArrDelay, DepDelay, Origin, Dest, Distance, TaxiIn, TaxiOut, Cancelled, CancellationCode, Diverted, CarrierDelay, WeatherDelay, NASDelay, SecurityDelay, LateAircraftDelay, Year, Month FROM airtraffic_yearly_2008_staging;
sqoop export --connect jdbc:mysql://52.207.2.108/Airline --username temp --password temp --table airtraffic_yearly --export-dir /bde_db/daniel_airtraffic_yearly
--Rollback process
--ADD 2003 December data, REMOVE 2008 December data.
--Shellscript
show partitions airtraffic_yearly;
list of partitions
sort
check how many partitions are there with count
if < 60, load else ignore
if > 60, drop partition and hdfs dfs -rm
else load data
beeline -u !connect jdbc:hive2://ec2-52-207-2-108.compute-1.amazonaws.com:10000/default;principal=hive/[email protected] QUERY
--ADD the rest of 2003 data, REMOVE the rest of 2008 data