- Hive Tutorial
- 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
- HiveQL
- HiveQL - Select Where
- HiveQL - Select Order By
- HiveQL - Select Group By
- HiveQL - Select Joins
- 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 - What Hive can not offer
A - storing data in tables and columns
Answer : B
Explanation
Hive is suited for effectively organizing and querying the store data and not inserting/updating data which is required for OLTP.
Q 2 - The 2 default TBLPROPERTIES added by hive when a hive table is created is
A - hive_version and last_modified by
B - last_modified_by and last_modified_time
Answer : B
Explanation
These are the 2 properties which are by default added by Hive
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 - 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
Answer : D
Explanation
Data is independent of schema in Hive.
Q 5 - Consider the query SELECT explode(city_locality) from ALL_LOCALITIES , where city_locality is a ARRAY dat atype. This will return
A - all th array elements as one row for each input array
B - zero or more rows, for each element for each input array
C - Each of the array element as one column for each input array
D - zero ormore columns for each element for each input array
Answer : B
Explanation
The explode() function expands each element of ARRAY into a row.
Q 6 - A view in Hive can be seen by using
Answer : A
Explanation
There is no separate clause for viewing views. It is shown using show tables.
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 - 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
Answer : B
Explanation
This property decides the number files to be looked into for the sample result.
Q 9 - Aggregate functions in Hive are the function which
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 : B
Explanation
Examples functions are − count, avarege etc.
Q 10 - When one of the join tables is small enough to fit into memory, The type of join used by Hive is
Answer : B
Explanation
As one of the tables already fits into the memory each row of the big table is quickly compared with each row of small table using Map Join.