- Hive - Home
- Hive - Introduction
- Hive - Installation
- Hive - Data Types
- Hive - Create Database
- Hive - Drop Database
- Hive - Create Table
- Hive - Alter Table
- Hive - Drop Table
- Hive - Partitioning
- Hive - Built-In Operators
- Hive - Built-In Functions
- Hive - Views And Indexes
- Hive Useful Resources
- Hive - Questions and Answers
- Hive - Quick Guide
- Hive - Useful Resources
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.
Q 1 - in hive when the schema does not match the file content
B - It reads only the string data type
Answer : D
Explanation
Instead of returning error, Hive returns null values for mismatch between schema and actual data.
Q 2 - The difference between the MAP and STRUCT data type in Hive is
A - MAP is Key-value pair but STRUCT is series of values
C - The Keys in MAP can not be integers but in STRUCT they can be.
Answer : D
Explanation
Each element in MAP type should be of same data type but in STRUCT it need not be so.
Q 3 - To see the partitions present in a Hive table the command used is
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
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
Answer : C
Explanation
Hive reads the tables from left to right. Small tables should be read first and if possible cached into the memory.
Q 6 - The DISTRIBUTED BY clause in hive
A - comes Before the sort by clause
B - comes after the sort by clause
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
Answer : D
Explanation
Hive is schema on Read and It does not throw error for mismatch between schema and actual data.
Q 8 - Hive.exec.compress.output controls
A - The output compression of map tasks
B - The output compression of reduce tasks
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
Answer : A
Explanation
reverse(abcd) gives dcba. So it is a standard UDF.
Q 10 - To add a new user defined Function permanently to Hive, we need to
A - Create a new version of HIve
B - Add the .class Java code to FunctionRegistry
Answer : B
Explanation
Functionregistry holds the list of all permanent functions