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.

Questions and Answers

Q 1 - The query "SHOW DATABASE LIKE 'h.*' ; gives the output with database name

A - containing h in their name

B - starting with h

C - ending with h

D - containing 'h.'

Answer : B

Explanation

Hive support regular expressions which are derived from regex capabilities of Java language.

Answer : A

Explanation

Copying data is done by OS commands and not Hive

Answer : B

Explanation

It is a program to read and write files using Java Input and Output formats.

Q 4 - While querying a hive table for a Array type column, if the array index is nonexistent then

A - NULL is returned

B - Error is reported.

C - Partial results are returned

D - "NA" is returned

Answer : A

Explanation

Hive returns NULL while in java it would have returned index out of bound error

Q 5 - To select all columns starting with the word 'Sell' form the table GROSS_SELL the query is

A - select '$Sell*'  from GROSS_SELL

B - select 'Sell*' from GROSS_SELL

C - select 'sell.*' from GROSS_SELL

D - select  'sell[*]' from GROSS_SELL

Answer : C

Explanation

Hive supports java based regular expression for querying its metadata.

Q 6 - A view in Hive can be seen by using

A - SHOW TABLES

B - SHOW VIEWS

C - DESCRIBE VIEWS

D - VIEW VIEWS

Answer : A

Explanation

There is no separate clause for viewing views. It is shown using show tables.

Answer : A

Explanation

Hive is case insensitive

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

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

hive_questions_answers.htm
Advertisements