-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHive External Table.HQL
53 lines (45 loc) · 1.2 KB
/
Hive External Table.HQL
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
*** External table for ad_campaigns_data_analysis ***
CREATE EXTERNAL TABLE ad_campaigns_data_analysis (
campaign_id STRING,
`date` STRING,
hour STRING,
type STRING,
value STRING,
event STRUCT<field1:STRING, field2:INT>
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.JsonSerDe'
WITH SERDEPROPERTIES (
"serialization.format" = "1"
)
STORED AS TEXTFILE
LOCATION '/tmp/output_data/ad_campaigns/';
*** External table for user_profile_data_analysis ***
CREATE EXTERNAL TABLE ad_campaigns_data_analysis (
campaign_id STRING,
`date` STRING,
hour STRING,
type STRING,
value STRING,
event STRUCT<field1:STRING, field2:INT>
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.JsonSerDe'
WITH SERDEPROPERTIES (
"serialization.format" = "1"
)
STORED AS TEXTFILE
LOCATION '/tmp/output_data/user_profile;
*** External table for user_profile_data_analysis ***
CREATE EXTERNAL TABLE stores_data_analysis (
campaign_id STRING,
`date` STRING,
hour STRING,
type STRING,
value STRING,
event STRUCT<field1:STRING, field2:INT>
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.JsonSerDe'
WITH SERDEPROPERTIES (
"serialization.format" = "1"
)
STORED AS TEXTFILE
LOCATION '/tmp/output_data/stores/;