- 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 - The partition of an Indexed table is dropped. then,
A - Corresponding partition from all indexes are dropped.
Answer : A
Explanation
As indexes are defined on a table, the removal of table partition also removes the respective index.
Q 2 - The tables created in hive are stored as
A - a subdirectory under the database directory
B - a file under the database directory
Answer : A
Explanation
Each database becomes a directory and each table becomes a file in that directory
Q 3 - The main advantage of creating table partition is
A - Effective storage memory utilization
Answer : B
Explanation
Partitioning creates subdirectories and only those subdirectories are read to fetch the query result, improving the performance.
Q 4 - The position of a specific column in a Hive table
A - can be anywhere in the table creation clause
B - must match the position of the correspondingĀ data in the data file
C - Must match the position only for date time data type in the data file
Answer : B
Explanation
It is up to the user to ensure the synchronization between schema and data
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 - 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 - If an Index is dropped then
A - The underlying table is also dropped
B - The underlying table is not dropped
Answer : D
Explanation
AN index can be dropped only after dropping the table on which index is created.
Q 8 - Setting the local mode execution to true causes
A - All tasks are executed on data available closet to the namenode
B - All tasks are executed only on a single machine
C - All the data files are cached on a datanode before query execution
Answer : B
Explanation
Local mode avoid creating mapreduce job while running the job in a single machine.
Q 9 - A Table Generating Function is a 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 : C
Explanation
Examples functions is Explode()
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.