- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Hive Mock Test
This section presents you various set of Mock Tests related to Hive. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Hive Mock Test I
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 - 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 3 - The results of a hive query can be stored as
Answer : C
Explanation
Using the command INSERT OVERWRITE DITECTORY ….. data can be exported to both local and hdfs file system.
Q 4 - Which of the following is not a complex data type in Hive?
Answer : A
Explanation
There is no Matrix data type in Hive.
Q 5 - The thrift service component in hive is used for
A - moving hive data files between different servers
B - use multiple hive versions
Answer : C
Explanation
Client machines can use programing languages like Java, Ruby etc to access Hive remotely using Hive Thrift service.
Q 6 - The default delimiter in hive to separate the element in STRUCT is
Answer : B
Explanation
The four default delimiters are − \n for record separator,
001\ for field separator
002\ for element separator in ARRAY or STRUCT
003\ for element separator in MAP
Answer : A
Explanation
The schema only refers to the data stored and data is not validated against schema when inserted or loaded.
Q 8 - 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 9 - The query "SHOW DATABASE LIKE 'h.*' ; gives the output with database name
Answer : B
Explanation
Hive support regular expressions which are derived from regex capabilities of Java language.
Q 10 - Each database created in hive is stored as
Answer : A
Explanation
Each database becomes a directory and each table becomes a file in that directory
Q 11 - 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 12 - By default when a database is dropped in Hive
A - the tables are also deleted
B - the directory is deleted if there are no tables
Answer : B
Explanation
Hive does not recursively delete the directory. So tables must be dropped first.
Q 13 - If the database contains some tables then it can be forced to drop without dropping the tables by using the keyword
Answer : D
Explanation
CASCADE clause drops the table first before dropping the database
Q 14 - Using the ALTER DATABASE command in an database you can change the
Answer : C
Explanation
only dbproperties are changed through this command
Answer : A
Explanation
Copying data is done by OS commands and not Hive
Q 16 - The drawback of managed tables in hive is
A - they are always stored under default directory
Answer : D
Explanation
As they are managed by Hive metadata, other applications cannot access it.
Q 17 - On dropping a managed table
A - The schema gets dropped without dropping the data
Answer : D
Explanation
As it is hive managed table both the data and schema definition are dropped.
Q 18 - On dropping an external table
A - The schema gets dropped without dropping the data
Answer : A
Explanation
As the data is stored externally Hive only drops the schema.
Q 19 - 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 20 - 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 21 - To see the data types details of only a column (not the table) we should use the command
Answer : A
Q 22 - The partitioning of a table in Hive creates more
A - subdirectories under the database name
Answer : B
Explanation
Partitions of a table creates more subdirectories under it.
Q 23 - The "strict" mode when querying a partitioned table is used to
A - stop queries of partitioned tables without a where clause
B - automatically add a where clause to the queries on a partitioned table
Answer : A
Explanation
The strict mode is designed to avoid long running jobs.
Q 24 - 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 25 - To see the partitions present in a Hive table the command used is
Answer : B
Explanation
SHOW PARTTIONS table_name
Answer Sheet
Question Number | Answer Key |
---|---|
1 | A |
2 | B |
3 | C |
4 | A |
5 | C |
6 | B |
7 | A |
8 | D |
9 | B |
10 | A |
11 | A |
12 | B |
13 | D |
14 | C |
15 | A |
16 | D |
17 | D |
18 | A |
19 | D |
20 | B |
21 | A |
22 | B |
23 | A |
24 | B |
25 | B |