forked from singhakbhu/retail_db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HIVE-DDL-retail_db.txt
77 lines (62 loc) · 1.74 KB
/
HIVE-DDL-retail_db.txt
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
retail_db tables
================
CREATE EXTERNAL TABLE IF NOT EXISTS retail_db.categories (
category_id int,
category_department_id int,
category_name string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/cloudera/ashish/Sqoop/retail_db/categories'
CREATE EXTERNAL TABLE IF NOT EXISTS retail_db.customers (
customer_id int,
customer_fname string,
customer_lname string,
customer_email string,
customer_password string,
customer_street string,
customer_city string,
customer_state string,
customer_zipcode string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/cloudera/ashish/Sqoop/retail_db/customers'
CREATE EXTERNAL TABLE IF NOT EXISTS retail_db.departments (
department_id int,
department_name string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/cloudera/ashish/Sqoop/retail_db/departments'
CREATE EXTERNAL TABLE IF NOT EXISTS retail_db.order_items (
order_item_id int,
order_item_order_id int,
order_item_product_id int,
order_item_quantity int,
order_item_subtotal float ,
order_item_product_price float
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/cloudera/ashish/Sqoop/retail_db/order_items'
CREATE EXTERNAL TABLE IF NOT EXISTS retail_db.orders (
order_id int,
order_date date,
order_customer_id int,
order_status string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/cloudera/ashish/Sqoop/retail_db/orders'
CREATE EXTERNAL TABLE IF NOT EXISTS retail_db.products (
product_id int,
product_category_id int,
product_name string,
product_description string,
product_price float ,
product_image string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LOCATION '/user/cloudera/ashish/Sqoop/retail_db/products'