Hive Online Quiz


Advertisements


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

Answer : A

Explanation

As the data is stored externally Hive only drops the schema.

Q 3 - Users can pass configuration information to the SerDe using

A - SET SERDEPRPERTIES

B - WITH SERDEPRPERTIES

C - BY SERDEPRPERTIES

D - CONFIG SERDEPRPERTIES

Answer : B

Explanation

This feature of SrrDe is used to customize Hive for a wide range of file formats

Q 4 - If we change the partition location of a hive table using ALTER TABLE option then the data for that partition in the table

A - also moves automatically to the new location

B - has to be dropped and recreated

C - has to  be backed up into a second table and restored

D - has to be moved manually into new location

Answer : D

Explanation

Data is independent of schema in Hive.

Q 5 - The clause used to limit the number of rows returned by a query is

A - LIMIT

B - ROWNUM

C - RESTRICT

D - MAXROW

Answer : A

Explanation

LIMIT restricts the number of rows returned by a query.

Q 6 - Which kind of keys(CONSTRAINTS)  Hive can have?

A - Primary Keys

B - Foreign Keys

C - Unique Keys

D - None

Answer : D

Explanation

Hive is schema on read and unlike RDBMS it does not have a way to enforce the existence of keys.

Answer : D

Explanation

It is about creating index on an empty table.

Q 8 - The Property that decides what is the maximum number of files that can be sampled during the use of the LIMIT clause is

A - hive.limit.optimize.file.max

B - hive.limit.optimize.limit.file

C - hive.limit.optimize.file.restrict

D - hive.limit.optimize.limit.most

Answer : B

Explanation

This property decides the number files to be looked into for the sample result.

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 - Which of the following File Formats are supported by Hive?

A - Text Files

B - Sequnce FIles

C - RC Files

D - All of the above

Answer : D

Explanation

Hive supports all these three file formats as they are also supported by Hadoop in general


hive_questions_answers.htm

Advertisements