- 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 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 II
Q 1 - 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 2 - The free-form query import feature in sqoop allows to import data from
B - a relational source without using a connector
Answer : C
Explanation
With the The free form query we can write a sql query involving a join between 2 tables and mention it with --query parameter while importing. It is used in place of the --table parameter.
Q 3 - The clause 'WHERE $CONDITIONS' in the sql query specified to import data, serves the purpose of
A - split the query result into multiple chunks while importing
B - picking a subset of rows from a table
C - specify the database from where the data needs to be imported
D - Specify the target directory where the data will be stored.
Answer : A
Explanation
The WHERE $CONDITION is used to split the result of the SQL query into multiple chunks.
Q 4 - The parameter to give a custom name to the mapreduce job running a sqoop import command is −
Answer : C
Explanation
The --mapreduce-job-name is used to give a user chosen job name to the sqoop command so that it can be easliy distinguished from other jobs in the jobtracker UI.
Q 5 - While using a free-form query to import data, Sqoop finds that two columns from the joined tables have the same name. In this case the job
B - will run ignoring the column from each table
C - will prompt the user to rename one of the columns
D - automatically create an alias for one of the columns as succeed the job.
Answer : A
Explanation
The job will fail as the mapreduce job creates java classes for each of the column names and two java classes cannot have the same name in the same mapreduce job.
Q 6 - The –boundary-query parameter is used to
A - Select the maximum number of rows to be retrieved by the query
B - Select maximum and minimum values of the column specified in the –split-by parameter
C - Select the number of splits they query can run
D - Select the maximum and minimum number of mapreduce tasks that will be used in the query.
Answer : B
Explanation
Sqoop needs to find the minimum and maximum value of the column
specified in the --split-by parameter so that sqoop can partition data into multiple independent slices that will be transferred in a parallel manner.
Q 7 - In a table import the name of the mapreduce job
A - Is named after the table name
Answer : A
Explanation
The name of the job is based on the name of the table which is being imported.
Q 8 - 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 9 - Data Transfer using sqoop can be
A - only imported into the Hadoop system
Answer : B
Explanation
The data can be both imported and exported form Hadoop system using sqoop.
Q 10 - While importing data into Hadoop using sqoop the SQL SELCT clause is used. Similarly while exporting data form Hadoop the SQL clause used is
Answer : D
Explanation
The INSERT statements are generated by sqoop to insert data into the relational tables.
Q 11 - While inserting data into Relational system from Hadoop using sqoop, the various table constraints present in the relational table must be
Answer : D
Explanation
We must verify that the data being exported does not violate the constraints error.
Q 12 - The export and import of data between sqoop and relational system happens through which of the following programs?
Answer : B
Explanation
The sqoop client only submits the command and oversees the completion or failure of the command. The Mapreduce job created will do the actual data transfer.
Q 13 - 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 14 - Sqoop’s default behavior while inserting rows into relational tables is
B - multiple rows depending on the memory availability
C - It depends on the database driver being used
D - Executes random number of insert statements depending on the CPU availability
Answer : A
Explanation
the default behavior is to insert one row at a time while it can be configured for bulk load.
Q 15 - Which parameter in sqoop is used for bulk data export to relational tables?
Answer : B
Explanation
The –batch parameter uses the JDBC batch load capability to do bulk load.
Q 16 - 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 17 - The parameter which decided How many rows will be inserted per transaction in sqoop is
A - Dsqoop.export.rows.per.transaction
B - Dsqoop.export.records.per.transaction
Answer : D
Explanation
The parameter
Dsqoop.export.statements.per.transaction decides how many rows will be inserted for transaction.
Q 18 - The insert query used to insert exported data into tables is generate by
A - Sqoop command and processed as such
Answer : A
Explanation
The insert query is generated only by the sqoop command and processed as such without any further modification by any other driver.
Q 19 - 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 20 - What happens if the sqoop generated export query is not accepted by the database?
Answer : A
Explanation
The export fails if the query is not accepted by the database.
Q 21 - Using the higher value for the parameter sqoop.export.statements.per.transaction will
A - Always increase the export performance
B - May or may not increase the export performance
Answer : C
Explanation
In the scenario when the database requires table_level write lock, higher value of sqoop.export.statements.per.transaction will lock the table for a longer time and will decrease the performance.
Q 22 - The –staging-table parameter is used for
A - Storing some sample data from Hadoop before loading the real table
B - Storing all the required data from Hadoop before loading it to real table
D - Storing the metadata structure of tables to which data is being exported
Answer : B
Explanation
When you want to verify that indeed all the require data is successfully exported before loading the data to final table, use the parameter –staging-table.
Q 23 - With the –staging-table parameter, the data is moved from staging to final table
A - Automatically if staging load is successful
B - Has to be done by user after verifying the data in staging
Answer : A
Explanation
sqoop runs another mapreduce job to load the final table after the staging load completes successfully.
Q 24 - Which of the following is a disadvantage of using the –staging-table parameter?
A - Data is stored twice and consumes more memory
B - The overall export time is more than direct export to final table
C - User should ensure the structure of staging table and final tables are in Sync.
Answer : D
Explanation
All the listed options are disadvantages while using the –staging-table option.
Q 25 - 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.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | A |
2 | C |
3 | A |
4 | C |
5 | A |
6 | B |
7 | A |
8 | B |
9 | B |
10 | D |
11 | D |
12 | B |
13 | C |
14 | A |
15 | B |
16 | A |
17 | D |
18 | A |
19 | D |
20 | A |
21 | C |
22 | B |
23 | A |
24 | D |
25 | C |