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

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

As the data is stored externally Hive only drops the schema.

Q 3 - If the directory for a partition does not exist, and a query is executed for this partition then

A - error is thrown

B - mapreduce job is not triggered

C - Result from a random partition is returned.

D - No result are returned

Answer : D

Explanation

The map reduce job is triggered but no result will be returned.

Answer : B

Explanation

It is up to the user to ensure the synchronization between schema and data

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.

Answer : B

Explanation

When the small one is cached, each row from the larger table can be efficiently compared with each row of the small table.

Answer : A

Explanation

The query is run on complete data set and then the results are restricted using LIMIT clause.

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

Answer : B

Explanation

Functionregistry holds the list of all permanent functions


hive_questions_answers.htm

Advertisements