- 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 - SerDe
A - parses records to columns while reading and columns to records when writing
B - parses records to columns while writing and columns to records when reading
C - creates partitions from columns using each of the records
Answer : A
Explanation
Converting records to columns is serializing and the reverse is Deerializing
Q 4 - Partitioned can be prevented from being
Answer : A
Explanation
using the ALTER TABLE.. ENABLE NO_DROP & ENABLE OFFLINE clause.
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 - Which kind of keys(CONSTRAINTS) Hive can have?
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 - The LIMIT clause applied to a select query
A - Executes the entire query before the LIMIT clause
B - Hive fetches one row at a time until it gets the required limit.
C - Creates a temporary file and stores the query result their
Answer : A
Explanation
The query is run on complete data set and then the results are restricted using LIMIT clause.
Q 8 - Intermediate compression in Hive is about
A - Compressing the data just before it is read by mapreduce task
B - Compressing the data just before it is output to the user
C - Compressing the data before it is stored by into the disk
D - Compressing the data shuffled between the map and reduce tasks
Answer : D
Explanation
Data compression between map and reduce task is called intermediate compression.
Q 9 - A standard user-defined function (UDF) refers to any function that
A - Takes one or more columns form a row and returns a single value
B - Takes one or more columns form many rows and returns a single value
C - Take zero or more inputs and produce multiple columns or rows of output
D - Detects the type of input programmatically and provides appropriate response
Answer : A
Explanation
Examples functions are concat, reverse etc.
Q 10 - A user creates a UDF which accepts arguments of different data types, each time it is run. It is an example of
Answer : B
Explanation
Generic functions are created as java programs and can accept variable data types.