ICP 5 - bhargavi1411/BigDataProgramming GitHub Wiki

Name : Bhargavi Saipoojitha Chennupati

Class ID : 4

Hadoop and SQL Transfer Tool - Sqoop

Part-1:

  1. First you need to start the mysql service.

    To start mysql you need to type the command "sudo service mysqld start"

2.List the databases and create a database and use that database.

To list existing databases we use the command 'show databases'.

To create a new database we use the command 'create database databasename'.

To use the existing database we use the command ' use databasename'.

  1. Create a table.

    To create a table, we use the command 'create table tablename( );

  1. Insert values into the table and display the table .

    To insert values into the table, we use the command ' insert into tablename values ( );

    To display the table we use the command 'select *from tablename'

5.Import the table from sql to hadoop using sqoop as shown below.

6.Importing to a target directory using sqoop as shown below.

7.Exporting table Table acad2 created in mysql for exporting from hadoop to sql.

Part 3 :

1.created a table 'stocks' and described stocks table.

  1. Loaded stocks.csv into stocks table and displayed stocks table.

3.Create a table stocks in mysql and export the hive table to mysql using sqoop.

  1. Compute Statistics

5.To Compute Word count

6.For identfying patterns

a) To identify the stocks where difference b/w open and close prices is less than $2.

b)Top 10 volumes for ibm stocks.

c)To identify stock with the maximum volume(val5) and show it's adjusted closing price(val6), closing price(val4).

d)Using regular expression to identify a given input.