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 - The parameter in sqoop which specifies the output directories when importing data is
Answer : D
Explanation
The --target-dir and --warehouse-dir are the two parameters used for specifying the path where import will be done.
Q 2 - what option can bne used to import only some of the table from a database while using the --import-all-tables parameter?
Answer : D
Explanation
You can mention the tables names along with the --exclude-table clause to skip a given number of tables while importing an entire database.
Q 3 - What is achieved by using the --meta-connect parameter in a sqoop command?
A - run metastore as a service accessible remotely
B - run metastore as a service accessible locally
C - connect to the meastore tables
D - connect to the metadata of the external relational tables form which data has to be imported
Answer : A
Explanation
with the --meta-connect parameter the metastore starts running as a service with the default port 16000.Now this metastore service becomes accessible throughout the cluster.
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 - Using the staging-table parameter while loading data to relational tables the creation of staging table is done
Answer : C
Explanation
The user has to ensure that the staging tab e is created and accessible by sqoop.
Q 6 - With MySQL, the feature used by sqoop for update or insert data into an exported table is
Answer : A
Explanation
The ON DUPLICATE KEY UPDATE feature of mySql is used for update else insert with sqoop.
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 - While importing data to hive using sqoop, if data already exists in hive table then the default behaviour is
A - The incoming data is appended to hive table
B - the incoming data replaces data in hive table
C - The data only gets updated using the primary key of the hive table
Answer : A
Explanation
The default behavior is to append data into existing hive table.
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