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.

Questions and Answers

Hive Mock Test IV

Q 1 - Which of the following scenarios are not prevented by enabling strict mode in Hive?

A - Scanning all the partitions

B - Generating random sample of data

C - Running a order by clause without a LIMIT clause

D - Cartesian product

Answer : B

Explanation

The other three scenarios create long running job. So STRICT mode is applied to them.

Q 2 - If a hive query produces unexpected result then its cause can be investigated by using

A - Block size in HDFS

B - Virtual columns

C - Virtual parameters

D - Query logs

Answer : B

Explanation

Virtual columns give the complete path and name of data block from where the error is arising.

Answer : D

Explanation

Data compression between map and reduce task is called intermediate compression.

Answer : C

Explanation

This property controls the compression of the output generated by a query.

Answer : C

Explanation

When files are not splitable , querying them becomes inefficient.

Q 6 - Which of the below is not a type compression option for Sequence file

A - RECORD

B - BLOCK

C - COLUMN

D - NONE

Answer : C

Explanation

There is no COLUMN compression type for a sequence file

Answer : A

Explanation

This property controls the logging in command line Interface.

Answer : B

Explanation

This property controls the logging in Mapreduce tasks

Q 9 - The command to list the functions currently loaded in a Hive Session is

A - LIST FUNCTIONS

B - SHOW FUNCTIONS

C - DECSRIBE FUNCTIONS

D - FIND FUNCTIONS

Answer : B

Explanation

SHOW FUNCTIONS produces list of all the functions currently available in hive session

Q 14 - The explode() function in hive takes an array of input and iterates through it returning each element as a separate row. This is an example of

A - Standard UDF

B - Aggregate UDF

C - Table Generating UDF

D - None

Answer : C

Explanation

SELECT explode(array(1,2,3)) AS element FROM src;

gives
1
2
3
so it is table generating function

Q 15 - The reverse() function reverses a string passed to it in a Hive query. This is an example of

A - Standard UDF

B - Aggregate UDF

C - Table Generating UDF

D - None

Answer : A

Explanation

reverse(‘abcd’) gives ‘dcba’. So it is a standard UDF.

Q 16 - A user creates a UDF which accepts arguments of different data types, each time it is run. It is an example of

A - Aggregate Function

B - Generic Function

C - Standard UDF

D - Super Functions

Answer : B

Explanation

Generic functions are created as java programs and can accept variable data types.

Answer : B

Explanation

Functionregistry holds the list of all permanent functions

Answer : D

Explanation

All the listed filesystem can be accessed using UDF

Answer : B

Explanation

Macros are created for the purpose of calling other functiuons

Q 20 - Calling a unix bash script inside a Hive Query is an example of

A - Hive Pipeline

B - Hive Caching

C - Hive forking

D - Hive Streaming

Answer : D

Explanation

In this type of streaming the code resides in the script being called and Hive is not aware of the code.

Q 21 - Hive can be accessed remotely by using programs written in C++, Ruby etc, over a single port. This is achieved by using

A - HiveServer

B - HiveMetaStore

C - HiveWeb

D - Hive Streaming

Answer : A

Explanation

HiveServer or Hive Thrift service is used to access Hive remotely.

Q 22 - Which of the following File Formats are supported by Hive?

A - Text Files

B - Sequnce FIles

C - RC Files

D - All of the above

Answer : D

Explanation

Hive supports all these three file formats as they are also supported by Hadoop in general

Q 23 - When one of the join tables is small enough to fit into memory, The type of join used by Hive is

A - Inner Join

B - Map join

C - Reduce Join

D - Sort Join

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.

Q 24 - The Hive metadata can be easily created and edited using

A - HCatalog

B - HMetamanager

C - Hweblog

D - Hue

Answer : A

Explanation

Hcatalog stores metadata information for many Hadoop tools like Hive and Mapreduce. It can be accessed through a web interface.

Q 25 - Hive supports row-level Inser/update and Delete using the ACID features only on which file format?

A - SequenceFile

B - Text File

C - ORC file

D - RC file

Answer : C

Explanation

Except the ORC file all other files types do not support insert or update.

Answer Sheet

Question Number Answer Key
1 B
2 B
3 D
4 C
5 C
6 C
7 A
8 B
9 B
10 A
11 B
12 C
13 D
14 C
15 A
16 B
17 B
18 D
19 B
20 D
21 A
22 D
23 B
24 A
25 C
hive_questions_answers.htm
Advertisements