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 - To import data to Hadoop cluster from relational database sqoop create a mapreduce job. In this job
A - All the data is transferred in one go.
B - each mapper transfers a slice of Table's data
C - Each mapper transfers tables' data along with table's metadata (name of the columns etc)
D - Only the schema of relational table is validated without fetching data
Answer : B
Explanation
A Mapreduce job executes multiple mappers and each mapper retrieves a slice of Table's data.
Q 2 - The data type mapping between the database column and sqoop column can be overridden by using the parameter
Answer : D
Explanation
As sqoop uses the Java Data types internally, the mapping of the data types has to be done with Java Data Types.
Q 3 - The --options-file parameter is used to
B - specify the name of the data files to be created after import
C - store all the sqoop variables
D - store the parameters and their values in a file to be used by various sqoop commands.
Answer : D
Explanation
The command line options (the name and value of the parameters) that do not change from time to time can be saved into a file and used again and again. This is called an options file.
Q 4 - In the import involving join of two tables the if there are two columns with matching name between two tables then this conflict can be resolved by
C - First creating temporary tables form each table with different column names
Answer : B
Explanation
We can create column aliases in the import query and the mapreduce job will refer to the column aliases, avoiding the conflict.
Q 5 - What does the parameter Dsqoop.export.records.per.statemet=10 do in a sqoop export command?
A - Exports 10 records in each insert statement
B - Export 10 insert statements every time the command runs
Answer : A
Explanation
The sqoop command submits the values form 10 records in each insert statement with this parameter.
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 - Load all or load nothing semantics is implemented by using the parameter
Answer : D
Explanation
The staging-table parameter is used to load all the required data into a intermediate table before finally loading into the real table.
Q 8 - The temporary location to which sqoop moves the data before loading into hive is specified by the parameter
Answer : A
Explanation
The --target-dir parameter mentions the directory used for temporary staging the data before loading into the hive table.
Q 9 - The parameter that can create a hbase table using sqoop when importing data to hbase is
Answer : B
Explanation
If thecreate-hbase-table is mentioned during the import then the Hbase table can get created using sqoop if it does not already exist.
Q 10 - The tool in sqoop which combines two data sets and preserves only the latest values using a primary key is
Answer : A
Explanation
The Sqoop-merge tool combines two datasets and preserves the latest records. The column marked for primary key is indicated by the parameter merge-key