Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

Sqoop Interview Questions and Answers For Freshers Part-5

Be First!

sqoop41.Give a Sqoop command to import all the records from employee table divided into groups of records by the values in the column department_id.
$ sqoop import –connect jdbc:mysql://db.foo.com/corp –table EMPLOYEES \
–split-by dept_id

42.What does the following query do?
$ sqoop import –connect jdbc:mysql://db.foo.com/somedb –table sometable \
–where “id > 1000” –target-dir /incremental_dataset –append
It performs an incremental import of new data, after having already imported the first 100,0rows of a table

43.Give a sqoop command to import data from all tables in the MySql DB DB1.
sqoop import-all-tables –connect jdbc:mysql://host/DB1

44.Give a command to execute a stored procedure named proc1 which exports data to from MySQL db named DB1 into a HDFS directory named Dir1.
$ sqoop export –connect jdbc:mysql://host/DB1 –call proc1 \
–export-dir /Dir1

45.What is a sqoop metastore?
It is a tool using which Sqoop hosts a shared metadata repository. Multiple users and/or remote users can define and execute saved jobs (created with sqoop job) defined in this metastore.

Clients must be configured to connect to the metastore in sqoop-site.xml or with the –meta-connect argument.

46.What is the purpose of sqoop-merge?
The merge tool combines two datasets where entries in one dataset should overwrite entries of an older dataset preserving only the newest version of the records between both the data sets.

47.How can you see the list of stored jobs in sqoop metastore?
sqoop job –list

48.Give the sqoop command to see the content of the job named myjob?
Sqoop job –show myjob

49.Which database the sqoop metastore runs on?
Running sqoop-metastore launches a shared HSQLDB database instance on the current machine.

50.Where can the metastore database be hosted?
The metastore database can be hosted anywhere within or outside of the Hadoop cluster..

(201)

Previous
Next

Leave a Reply