sqoop - Sqoop Eval - apache sqoop - sqoop tutorial - sqoop hadoop
What is Sqoop Eval?
- Sqoop eval tool can be applicable for both modeling and defining the SQL statements.
- 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.
Syntax
- The following syntax is used for Sqoop eval command.
Sqoop Eval Command With Example
- The sqoop eval command 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
- Using eval tool, we can evaluate any type of SQL query. Let us take an example of selecting limited rows in the wikitechy_employee table of db database.
- The below command is used to evaluate the given example using SQL query.
- After the execution of the command successfully, then it will produce the below output on the terminal.
Insert Query Evaluation
- Sqoop eval tool can be applicable for both modeling and defining the SQL statements.
- That means, we can use eval for insert statements too.
- Using the below command to insert a new row in the wikitechy_employee table of db database.
- After the execution of the command successfully, then it will display the status of the updated rows on the console.
- Otherwise, you can verify the wikitechy_employee table on MySQL console.
- Using the below command to verify the rows of wikitechy_employee table of db database using select’ query.