-
Notifications
You must be signed in to change notification settings - Fork 28
/
Sqoop Practice Questions 2.txt
58 lines (35 loc) · 2.69 KB
/
Sqoop Practice Questions 2.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
Import a table from mysql where there is not primary key in the table.
Split-by on a textual column.
user of --auto-reset-mapper
Import all customer record from the customers table in retail_db mysql database into HDFS path "/user/cloudera/output/retail_db/customers_text".
Fields should be tab delimited and all records must be imported into a single text file
Import all CLOSED customer orders from the orders table in retail_db mysql database into HDFS path "/user/cloudera/output/retail_db/orders_avro".
Records must be imported in avro format.
All imported records must be CLOSED orders.
Import all customer record from the customers table in retail_db mysql database into HDFS path "/user/cloudera/output/retail_db/customers_text".
Fields should be tab delimited and all records must be imported into a single text file
Import all CLOSED customer orders from the orders table in retail_db mysql database into HDFS path "/user/cloudera/output/retail_db/orders_avro".
Records must be imported in avro format.
All imported records must be CLOSED orders.
Import all order_items from the order_items and product tables in retail_db mysql database into HDFS path "/user/cloudera/output/retail_db/denorm_order_items".
The imported dataset must contain the following columns in this order: order_item_id, order_item_order_id, product_name, product_category_id, product_price, order_item_quantity, order_item_subtotal
Records must be imported in parquet format.
Export all record from HDFS location "/user/cloudera/rawdata/hist_forex/price_data" to the database table price_data in schema hist_forex;
1. Import all the records from the table order_items in the retail_db schema.
Fields should be delimited by tabs
Files should be compressed and located at /user/cloudera/classwork/retail_db/order_item
Run this query on your retail_db schema
create table order_item_2 as select * from order_items where 1 =2 ;
alter table order_item_2 drop order_item_order_id;
Now export all records from /user/cloudera/classwork/retail_db/order_item into the database table order_item_2
Exercise formulation
====================
1. Import all the records from the table order_items in the retail_db schema.
Fields should be delimited by tabs
Files should be compressed and located at /user/cloudera/classwork/retail_db/order_item
2. Run this query on your retail_db schema
create table order_item_2 as select * from order_items where 1 =2 ;
alter table order_item_2 drop order_item_order_id;
Now export all records from /user/cloudera/classwork/retail_db/order_item into the database table order_item_2
-------------------------------------------------------------------------------------------
Github : https://github.com/okmich/cca175notes