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 query "SHOW DATABASE LIKE 'h.*' ; gives the output with database name

A - containing h in their name

B - starting with h

C - ending with h

D - containing 'h.'

Answer : B

Explanation

Hive support regular expressions which are derived from regex capabilities of Java language.

Answer : D

Explanation

As it is hive managed table both the data and schema definition are dropped.

Q 3 - To see the partitions keys present in a Hive table the command used is

A - describe

B - show

C - describe extended

D - show extended

Answer : C

Explanation

The DESCRIBE EXTENDED command gives all the details

Q 4 - While querying a hive table for a Array type column, if the array index is nonexistent then

A - NULL is returned

B - Error is reported.

C - Partial results are returned

D - "NA" is returned

Answer : A

Explanation

Hive returns NULL while in java it would have returned index out of bound error

Answer : B

Explanation

The explode() function expands each element of ARRAY into a row.

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.

Q 7 - When importing data to using SerDe, if a row is found to have more columns than expected then

A - The extra columns are replaced with NULL

B - The row is skipped

C - The import halts with error

D - The Columns are ignored.

Answer : D

Explanation

Hive is schema on Read and It does not throw error for mismatch between schema and actual data.

Answer : C

Explanation

When files are not splitable , querying them becomes inefficient.

Answer : B

Explanation

Macros are created for the purpose of calling other functiuons

hive_questions_answers.htm
Advertisements