Skip to main content

Posts

Showing posts from May, 2018

sqoop

----------for database connect-------- mysql -u root -pcloudera ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >>sqoop import --connect jdbc://localhost/retail_db --username root --password cloudera --table customers --target-dir /data/sqoop/test01 >>sqoop import --connect jdbc:mysql://localhost/retail_db --username root --password cloudera --table customers --target-dir /data/sqoop/test02 -m 10 >>sqoop import --connect jdbc:mysql://localhost/retail_db --username root --password cloudera --table customers --target-dir /data/sqoop/test03 --split-by customer_id --fields-terminated-by '|' -m 10 >>sqoop list-databases --connect jdbc:mysql://localhost/retail_db --username root --password cloudera >>sqoop list-tables --connect jdbc:mysql://localhost/retail_db --username root --password cloudera -----------

important

create database veer; use veer; create table item_details(item_id int,item_name varchar(30),item_price int,item_color varchar(10)) row format delimited fields terminated by',' lines terminated by '\n' stored as textfile; hadoop fs -put /home/cloudera/sk/data/item.txt /user/hive/warehouse/veer.db/item select count(*) from item_details; select * from item_details order by item_id desc; select item_color,count(*) from item_details group by item_color; ---------------------------31-01-2018---------------------------------- create table flight_nt(s_id int,s_name varchar(30),code varchar(20),state varchar(40)) row format delimited fields terminated by',' lines terminated by '\n' stored as textfile; create table flightdata_part (s_id int, s_name varchar(30), code varchar(20) ) PARTITIONED BY (state VARCHAR(64)) row format delimited fields terminated by ',' lines terminated by '\n'  stored as textfile; LOAD DATA LOCAL INPATH '/local/home/srv