Sqoop Online Quiz


Advertisements


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.

Questions and Answers

Q 1 - 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 2 - 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 : A

Explanation

The WHERE $CONDITION is used to split the result of the SQL query into multiple chunks.

Q 4 - While inserting data into Relational system from Hadoop using sqoop, the various table constraints present in the relational table must be

A - Disabled temporarily

B - Dropped and re created

C - Renamed

D - Not violated

Answer : D

Explanation

We must verify that the data being exported does not violate the constraints error.

Q 5 - Using the –staging-table parameter while loading data to relational tables the creation of staging table is done

A - Automatically b sqoop

B - Automatically by database

C - User has to ensure it is created

D - Automatically created by a Hadoop process beyond sqoop

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

A - ON DUPLICATE KEY UPDATE

B - ON KEY UPDATE

C - ON NEW KEY UPDATE

D - ON NEW UPDATE

Answer : A

Explanation

The ON DUPLICATE KEY UPDATE feature of mySql is used for update else insert with sqoop.

Q 7 - The parameter to specify only a selected number of columns to be exported to a table is

A - -columns

B - –column-subset

C - ----columns-not-all

D - -columns-part

Answer : A

Explanation

The columns clause will take a comma separated values of column names which will be part of the export.

Q 8 - For a column of data type numeric, the parameter used for substituting null values is

A - -input-null-string

B - -input-null-non-string

C - -input-null-text

D - -input-null-varchar

Answer : B

Explanation

The –input- null-non-string is used to substitute null values for text based columns.

Answer : B

Explanation

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

Q 10 - 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

sqoop_questions_answers.htm

Advertisements