Apache Sqoop Eval Command With Example
Apache Sqoop is a command-line interface application for transferring data between relational databases and Hadoop. It supports incremental loads of a single table or a free form SQL query as well as saved jobs which can be run multiple times to import updates made to a database since the last import. Imports can also be used to populate tables in Hive or HBase. Exports can be used to put data from Hadoop into a relational database. Sqoop got the name from sql+hadoop. Sqoop became a top-level Apache project in March 2012.
1) A machine with Ubuntu 14.04 LTS operating system.
2) Apache Hadoop pre installed (How to install Hadoop on Ubuntu 14.04)
3) MySQL Database pre installed (How to install MySQL Database on Ubuntu 14.04)
4) Apache Sqoop pre installed (How to install Sqoop on Ubuntu 14.04)
Sqoop Eval Command With Example
This post describes how to use the Sqoop 'eval' tool. It allows users to execute user-defined queries against respective database servers and preview the result in the console. So, the user can expect the resultant table data to import. Using eval, we can evaluate any type of SQL query that can be either DDL or DML statement.
Step 1 - Change the directory to /usr/local/hadoop/sbin
Step 2 - Start all hadoop daemons.
Step 3 - The JPS (Java Virtual Machine Process Status Tool) tool is limited to reporting information on JVMs for which it has the access permissions.
Step 4 - Change the directory to /usr/local/sqoop/bin
Select Query Evaluation (See, How to use Sqoop Import command)
Using eval tool, we can evaluate any type of SQL query. Let us take an example of selecting limited rows in the employee table of db database. The following command is used to evaluate the given example using SQL query.
Insert Query Evaluation (See, How to use Sqoop Import command)
Sqoop eval tool can be applicable for both modeling and defining the SQL statements. That means, we can use eval for insert statements too. The following command is used to insert a new row in the employee table of db database.
Please share this blog post and follow me for latest updates on
Labels : Apache Sqoop Installation on Ubuntu Apahce Sqoop Import Command Example Apache Sqoop Export Command Example Apache Sqoop Job Command Example Apache Sqoop Codegen Command Example Apache Sqoop List-tables Command Example Apache Sqoop List-tables Command Example