- Sqoop Tutorial
- Sqoop - Home
- Sqoop - Introduction
- Sqoop - Installation
- Sqoop - Import
- Sqoop - Import-All-Tables
- Sqoop - Export
- Sqoop - Sqoop Job
- Sqoop - Codegen
- Sqoop - Eval
- Sqoop - List Databases
- Sqoop - List Tables
- Sqoop Useful Resources
- Sqoop - Questions and Answers
- Sqoop - Quick Guide
- Sqoop - Useful Resources
- Sqoop - Discussion
Sqoop Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Sqoop. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - While SequenceFile stores each record as key-value pair, the avro system stored records as
Answer : D
Explanation
Sqoop generates the schema automatically when reading the data and stores the schema details along with the data in each Avro file generated.
Q 2 - For some databases sqoop can to faster data transefr by using the parameter
Answer : D
Explanation
The direct mode delegates the data transferring capabilities to the native untilities provided by the database.
Q 3 - What is the disadvantage of storing password in the metastore as compared to storing in a password file?
Answer : D
Explanation
The password file can be encrypted and prevented from reading by proper permissions. But metastore is unencrypted and cannot be prevented from reading.
Q 4 - When does sqoop gather the metadata of the relational table into which it exports the data?
A - Gathers the metadata of all tables only once during establishing the connection to the database
B - Never as it relies on the user to ensure the exported data matches the table’s structure
C - Every time the sqoop export command it submitted and just before the data transfer starts.
D - Only if the export fails, Sqoop accesses the metadata of the table
Answer : C
Explanation
Every time a sqoop command is submitted, it verifies the metadata of the table before starting the export.
Q 5 - When the “sqoop.export.records.per.statement” is set to two or more, the query created by sqoop has the SQL form of
A - INSERT INTO TABLE VALUES(..);INSERT INTO TABLE VALUES(..); and so on.
B - BULK INSERT INTO TABLE VALUES(..),(…),(…);
Answer : D
Explanation
many databases use statements in option (D) to process multiple rows in the insert statement.
Q 6 - Sqoop can insert new rows and update existing changed rows into an already exported table by using the parameter
Answer : D
Explanation
the –update-mode allwoinsert can be used to update as well as insert existing rows into the exported table.
Q 7 - How do we decide the order of columns in which data is loaded to the target table?
A - By using -- order by parameter
B - By using a new mapreduce job aftet submitting sqoop export command
C - By using a database stored procedure
D - By using –columns parameter with comma separated column names in the required order.
Answer : D
Explanation
we can use the –column parameter and specify the required column in the required order.
Q 8 - While importing directly to hive using sqoop, if the table meta data does not exist in hive then
B - sqoop creates the meta data in hive
C - sqoop waits for user to input the meta data
D - sqoop imports the data as a file without creating any meta data
Answer : B
Explanation
as both sqoop and hive are part of hadoop ecosystem, sqoop is able to create the meta data in hive.
Q 9 - The parameter used to identify the individual row in HBase while importing data to it using sqoop is
Answer : A
Explanation
the parameter --hbase-row-key is used in sqoop to identify each row in the HBase table.
Q 10 - The sqoop export/import jobs canbe stored and used again and again by using
Answer : D
Explanation
Running a sqoop job by using sqoop-job statement saves the job into metastore which can be retrived later and used again and again
Example −
$ sqoop-job --create jobname -- import --connect jdbc:mysql://example.com/db \ --table mytable