Hive Online Quiz


Advertisements

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.

Questions and Answers

Answer : A

Explanation

As indexes are defined on a table, the removal of table partition also removes the respective index.

Answer : A

Explanation

Each database becomes a directory and each table becomes a file in that directory

Q 3 - To see the partitions present in a Hive table the command used is

A - Describe

B - show

C - describe extended

D - show extended

Answer : B

Explanation

SHOW PARTTIONS table_name

Answer : A

Explanation

using the ALTER TABLE…….. ENABLE NO_DROP & ENABLE OFFLINE clause.

Q 5 - The property set to run hive in local mode as true so that it runs without creating a mapreduce job is

A - hive.exec.mode.local.auto

B - hive.exec.mode.local.override

C - hive.exec.mode.local.settings

D - hive.exec.mode.local.config

Answer : A

Explanation

In local mode hive will not trigger a mapreduce job.

Answer : A

Explanation

A table can be created form a view

Q 7 - Consider the below two sets of queries.

Query A:
hive> INSERT OVERWRITE TABLE sales
	SELECT * FROM history WHERE action = 'purchased';
hive> INSERT OVERWRITE TABLE credits
	 SELECT * FROM history WHERE action = 'returned';

and 
Query B:

hive> FROM history
 INSERT OVERWRITE sales SELECT * WHERE action = 'purchased'
 INSERT OVERWRITE credits SELECT * WHERE action = 'returned'

Which of them will make a single pass through?

A - Query A

B - Query B

C - Both

D - None

Answer : B

Explanation

in Query B, the query is executed only once.

Q 8 - 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 9 - 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 10 - 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.

hive_questions_answers.htm
Advertisements