- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sqoop Mock Test
This section presents you various set of Mock Tests related to Sqoop. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Sqoop Mock Test I
Q 1 - Which of the following is used by sqoop to establish a connection with enterprise data warehouses?
Answer : B
Explanation
The JDBC driver is a java program which has been traditionally providing data base connectivity to a variety of databases.
Q 2 - Besides the JDBC driver, sqoop also needs which of the following to connect to remote databases?
Answer : C
Explanation
Sqoop Needs both JDBC driver and Database connector which is required to import data.
Q 3 - To run sqoop from multiple nodes, it has to be installed in
A - Any one of the in the local filesystem.
B - each of the node where it is supposed to run
Answer : A
Explanation
On installing in one node it, automatically gets replicated to other nodes in the cluster.
Q 4 - By default the records from databases imported to HDFS by sqoop are
Answer : D
Explanation
The default record separator is comm.
Q 5 - 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 6 - 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 7 - If there is already a target directory with the same name as the table being imported then
A - The directory gets deleted and recreated.
C - Another directory under the existing directory gets created.
Answer : B
Explanation
To prevent accidental deletion of data the job fails.
Q 8 - To prevent the password from being mentioned in the sqoop import clause we can use the additional parameters
Answer : C
Explanation
The -P option asks for password from standard input without echoing and --password-file option reads the password value stored in some other file.
Q 9 - What are the two binary file formats supported by sqoop?
Answer : A
Explanation
These are the two binary file formats supported by Sqoop.
Q 10 - 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 11 - The compression mechanism used by sqoop is
Answer : B
Explanation
Sqoop does not have any inbuilt code to carry out file compression. It relies on Hadoop's compression settings.
Q 12 - 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 13 - 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 14 - What does the num-mappers parameter serves?
A - force sqoop to use only one map task
B - set the number of map tasks sqoop can use
C - store the data imported by each map tasks in a separate file
Answer : B
Explanation
The default number of map task ssqoop uses is 4.
This can be altered using num-mappers parameter.
Q 15 - What is the default value used by sqoop when it encounters a missing value while importing form CSV file.
Answer : B
Explanation
unlike databases there is no NULL values in CSV files. Those are handled by sqoop by using null string.
Q 16 - What option can be used to import the entire database from a relational system using sqoop?
Answer : C
Explanation
The --import-all-tables is used to import all the tables from the database. The tables structure as well as data is imported one by one through this command.
Q 17 - 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.
Answer : C
Explanation
You can do both full and partial data import from tables but not a subset of columns from a table.
Q 19 - What are the two different incremental modes of importing data into sqoop?
Answer : D
Explanation
The --incremental parameter is used to fetch only the new data (data which does not already exist in hadoop) . It is done as an append if there are columns specified to be checked for new data. it cal also use the last modified parameter which will use the last_updated_date column from the existing table to identify the new row.
Q 20 - What does the --last-value parameter in sqoop incremental import signify?
A - What is the number of rows sucessfully imported in append type import
D - The count of the number of rows that were succesful in the current import.
Answer : C
Explanation
Sqoop uses the --last-value parameter in both the append mode and the last_update_date mode to import the incremental data form source.
Q 21 - 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 22 - while specifying the connect string in the sqoop import command, for a Hadoop cluster, if we specify localhost in place of a server address(hostname or IP address) in the URI, then
A - The import job will connect to local databases
B - Each node may connect to different databases
Answer : D
Explanation
Specifying localhost does not invalidate the command as some local database may be running and the node will be able to connect. So each node will connect to different database if they are available.
Q 23 - 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 24 - What is the advantage of storing password in a metastore as compared to storing in password in a file?
A - It can be run by any user with valid access to sqoop environment
B - The password in metastore can be updated while that in password file cannot be
C - The password file can be encrypted while the metastore cannot be encrypted
D - User intervention is required in password file but not in metastore.
Answer : A
Explanation
The main advantage of using metastore is it can be used by any user having access to the environment without knowing the password.
Q 25 - The argument in a saved sqoop job can be altered at run time by using the option
Answer : C
Explanation
For a saved job named 'job1' the --table parameter can be altered at run time by using the command below.
sqoop job --exec job1 -- --table-newtable.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | B |
2 | C |
3 | A |
4 | D |
5 | B |
6 | D |
7 | B |
8 | C |
9 | A |
10 | D |
11 | B |
12 | D |
13 | D |
14 | B |
15 | B |
16 | C |
17 | D |
18 | C |
19 | D |
20 | C |
21 | D |
22 | D |
23 | D |
24 | A |
25 | C |