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 IV

Answer : B

Explanation

The data is first staged into a temporary location as a HDFS file and then loaded into the hive table.

Answer : A

Explanation

The default behavior is to append data into existing hive table.

Q 3 - To overwrite data present in hive table while importing data using sqoop, the sqoop parameter is

A - --sqoop-overwrite

B - --hive-overwrite

C - --hive-delete-all

D - --sqoop-delete-all

Answer : B

Explanation

The --hive-overwrite parameter truncates the hive table before loading the data.

Q 4 - The temporary location to which sqoop moves the data before loading into hive is specified by the parameter

A - --target-dir

B - --source-dir

C - --hive-dir

D - --sqoop-dir

Answer : A

Explanation

The --target-dir parameter mentions the directory used for temporary staging the data before loading into the hive table.

Answer : D

Explanation

Sqoop supports loading into hive partitions using additional parameters in the sqoop command.

Answer : A

Explanation

both partition-key and partition value are passed in to load data into hive partitioned table.

Q 7 - The data type of the column used for partition name while importing data using sqoop ino hive can be

A - only string

B - string or numeric

C - only date

D - string without special characters

Answer : A

Explanation

Sqoop can only take strings as partition column names while loading data to hive.

Answer : C

Explanation

the parameter --hive-drop-import-delims removes the mentioned characters.

Answer : C

Explanation

As the characters \n, \t, and \01 may interfere with the data giving incorrect result, these can be replaced with a suitable string using this parameter.

Answer : A

Explanation

The new line characters present in data will increase the number of rows.

Answer : B

Explanation

This parameter can be used with both hive and text files.

Q 12 - To import data to HBase using sqoop the parameter(s) required is/are

A - --hbase-table

B - --hbase-columns

C - --hbase-table and --column-family

D - --habse-table and --hbase-column-family

Answer : C

Explanation

sqoop needs to mention both the hbase table name and column family to do the import.

Answer : B

Explanation

Unlike hive where sqoop creates the table if it does not exist, in HBase the job fails.

Q 14 - The parameter used to identify the individual row in HBase while importing data to it using sqoop is

A - --hbase-row-key

B - --hbase-rowkey

C - --hbase-rowid

D - --hbase-row-id

Answer : A

Explanation

the parameter --hbase-row-key is used in sqoop to identify each row in the HBase table.

Q 15 - The parameter that can create a hbase table using sqoop when importing data to hbase is

A - -hbase-create-table

B - -create-hbase-table

C - -create-hbase-table-columnlist

D - -create-hbase-table-rowkey

Answer : B

Explanation

If the–create-hbase-table is mentioned during the import then the Hbase table can get created using sqoop if it does not already exist.

Answer : C

Explanation

As Hbase does not allow the rows with all NULL values, those rows were skipped during import and caused fewer row counts.

Answer : A

Explanation

The property sqoop.hbase.add.row.key instructs Sqoop to insert the row key column twice, once as a row identifier and then again in the data itself. Even if all other columns contain NULL, at least the column used for the row key won’t be null, which will allow the insertion of the row into HBase.

Q 18 - When inserting data using sqoop into Hbase table in one physical node, the different parallel tasks of sqoop import create a bottleneck. This can be solved by

A - Configuring sqoop not to run parallel tasks

B - Configuring gHBase to accept rows in parallel

C - Creating more regions in HBAse table

D - Cannot be solved

Answer : C

Explanation

By creating more regions, the Hbase table get split into many nodes in the HBAse cluster, which help load data faster from the sqoop parallel load tasks.

Q 19 - The parameters in sqoop command can be passed in to Oozie by using which tags?

A - <parameters>

B - <args>

C - <sqoop>

D - <command>

Answer : B

Explanation

The <args> tag can contain the parameters of a sqoop command when scheduling with Oozie.

Answer : A

Explanation

The ValidationThreshold - Determines if the error margin between the source and target are acceptable: Absolute, Percentage Tolerant, etc. Default implementation is AbsoluteValidationThreshold which ensures the row counts from source and targets are the same.

Q 21 - The comparison of row counts between the source system and the target database while loading the data using sqoop is done using the parameter

A - --Validate

B - --Rowcount

C - -row(count)

D - -allrows

Answer : A

Explanation

The –validate parameter is used to show the result of row comparison between source and target.

Q 22 - The sqoop export/import jobs canbe stored and used again and again by using

A - sqoop- jobname

B - sqoop-save-job

C - sqoop-all-jobs

D - sqoop-job

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

Answer : B

Explanation

This is the command to execute a sqoop job already saved in the metastore.

Q 24 - The tool in sqoop which combines two data sets and preserves only the latest values using a primary key is

A - sqoop-merge

B - sqoop-combine

C - sqoop-preserve

D - sqoop-distinct

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

Q 25 - The tool that populates a Hive metastore with a definition for a table based on a database table previously imported to HDFS is

A - create-hive-table

B - import-hive-metastore

C - create-hive-metastore

D - update-hive-metastore

Answer : B

Explanation

Define in Hive a table named emps with a definition based on a database table named employees −

$ sqoop create-hive-table --connect jdbc:mysql://db.example.com/corp \
   --table employees --hive-table emps

Answer Sheet

Question Number Answer Key
1 B
2 A
3 B
4 A
5 D
6 A
7 A
8 C
9 C
10 A
11 B
12 C
13 B
14 A
15 B
16 C
17 A
18 C
19 B
20 A
21 A
22 D
23 B
24 A
25 B
sqoop_questions_answers.htm
Advertisements