Sqoop Mock Test


Advertisements


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.

Questions and Answers

Sqoop Mock Test I

Q 1 - Which of the following is used by sqoop to establish a connection with enterprise data warehouses?

A - RDBMS driver

B - JDBC Driver

C - IDBC Driver

D - SQL Driver

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?

A - Putty

B - SSH

C - Conenctor

D - sqoop client

Answer : C

Explanation

Sqoop Needs both JDBC driver and Database connector which is required to import data.

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

A - Tab separated

B - Concatenated columns

C - space separated

D - comma separated

Answer : D

Explanation

The default record separator is comm

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

A - --output-path

B - --target-path

C - --output-dir

D - --target-dir

Answer : D

Explanation

The --target-dir and --warehouse-dir are the two parameters used for specifying the path where import will be done

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

A - -p

B - --password-file

C - both of these

D - cannot be prevented

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?

A - Avro & SequenceFile

B - Rcfile and SequenceFile

C - ORC file and RC file

D - Avro and RC file

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

A - Simple text

B - chained lists

C - Linked lists

D - schema and data

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

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

A - --bulkload

B - --fastload

C - --dump

D - --direct

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

A - --override-column-type

B - --map-column-type

C - --override-column-java

D - --map-column-java

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.

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.

A - NULL

B - null

C - space character

D - No values

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?

A - --import-all-db

B - --import-all-tables

C - --import-all

D - --import

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?

A - --skip-tables

B - --without-tables

C - --forgo-tables

D - --exclude-tables

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?

A - merge and add

B - append and modified

C - merge and lastmodified

D - append and lastmodified

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.

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.

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

C - the import job may succeed

D - All of the above

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?

A - it is easily accessible

B - it may get deleted accidentally

C - It cannot be updated

D - it is unencrypted

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.

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

A - --alter

B - --newval

C - --exec

D - --changeparam

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

sqoop_questions_answers.htm

Advertisements