Hive Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Hive. 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 - The default delimiter in hive to separate the element in STRUCT is

A - '\001'

B - '\oo2'

C - '\oo3'

D - '\oo4'

Answer : B

Explanation

The four default delimiters are − \n for record separator,

001\ for field separator

002\ for element separator in ARRAY or STRUCT

003\ for element separator in MAP

Q 2 - If the database contains some tables then it can be forced to drop without dropping the tables by using the keyword

A - RESTRICT

B - OVERWRITE

C - F DROP

D - CASCADE

Answer : D

Explanation

CASCADE clause drops the table first before dropping the database

Q 3 - To see the data types details of only a column (not the table) we should use the command

A - DESCRIBE

B - DESCRIBE EXTENDED

C - DESCRIBE FORMATTED

D - DESCRIBE COLUMN

Answer : A

Q 4 - While querying a hive table for a column with MAP data type, the elements in the column are referenced by

A - Index

B - Key

C - Value

D - nested Index

Answer : B

Explanation

The MAP data type is a key-value pair and not index based.

Q 5 - The performance of an aggregate query is improved by setting which of the following property as true?

A - hive.map.group

B - hive.map.aggr

C - hive.map.sort

D - hive.map.sum

Answer : B

Explanation

SET hive.map.aggr = true;

Answer : C

Explanation

Hive does not manage the Index like RDBMS. SO it has to be built manually.

Q 8 - If a hive query produces unexpected result then its cause can be investigated by using

A - Block size in HDFS

B - Virtual columns

C - Virtual parameters

D - Query logs

Answer : B

Explanation

Virtual columns give the complete path and name of data block from where the error is arising.

Q 9 - The explode() function in hive takes an array of input and iterates through it returning each element as a separate row. This is an example of

A - Standard UDF

B - Aggregate UDF

C - Table Generating UDF

D - None

Answer : C

Explanation

SELECT explode(array(1,2,3)) AS element FROM src;

gives
1
2
3
so it is table generating function

Q 10 - Calling a unix bash script inside a Hive Query is an example of

A - Hive Pipeline

B - Hive Caching

C - Hive forking

D - Hive Streaming

Answer : D

Explanation

In this type of streaming the code resides in the script being called and Hive is not aware of the code.

hive_questions_answers.htm
Advertisements