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

Answer : D

Explanation

Instead of returning error, Hive returns null values for mismatch between schema and actual data.

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

A - Describe

B - show

C - describe extended

D - show extended

Answer : B

Explanation

SHOW PARTTIONS table_name

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

Q 5 - For optimizing join of three tables, the largest sized tables should be placed as

A - the first table in the join clause

B - second table in the join clause

C - third table in the join clause

D - Does not matter

Answer : C

Explanation

Hive reads the tables from left to right. Small tables should be read first and if possible cached into the memory.

Answer : A

Explanation

Sorting as the last clause will be efficient as that is also the last step in the reduce job producing the output.

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

This property controls the compression of the output generated by a query.

Q 9 - The reverse() function reverses a string passed to it in a Hive query. This is an example of

A - Standard UDF

B - Aggregate UDF

C - Table Generating UDF

D - None

Answer : A

Explanation

reverse(abcd) gives dcba. So it is a standard UDF.

Answer : B

Explanation

Functionregistry holds the list of all permanent functions

hive_questions_answers.htm
Advertisements