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 default delimiter in hive to separate the element in STRUCT is

A - '\001'

B - '\oo2'

C - '\oo3'

D - '\oo4'

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

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

Q 3 - To see the data types details of only a column (not the table) we should use the command

A - DESCRIBE

B - DESCRIBE EXTENDED

C - DESCRIBE FORMATTED

D - DESCRIBE COLUMN

Answer : A

Q 4 - When the result of the STRING data type is returned by querying array data type using index, the result have

A - no quotes

B - double suotes

C - single quotes

D - No spaces

Answer : A

Explanation

The STRINGS returned form ARRAYS will not contain the quotes.

Q 5 - The clause used to limit the number of rows returned by a query is

A - LIMIT

B - ROWNUM

C - RESTRICT

D - MAXROW

Answer : A

Explanation

LIMIT restricts the number of rows returned by a query.

Q 6 - A View in Hive can be dropped by using

A - DROP TABLE

B - DROP VIEW

C - DELETE VIEW

D - REMOVE VIEW

Answer : B

Explanation

DROP view drops the 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 - The default limit to the number of rows returned by a query can be done using which of the following parameter?

A - hive.limit.optimize.enable

B - hive.limit.enable.optimize

C - hive.optimize.enable.limit

D - hive.enable.limit.optimize

Answer : A

Explanation

This parameter is configured to change the default value of the number of rows returned

Answer : B

Explanation

Macros are created for the purpose of calling other functiuons

hive_questions_answers.htm
Advertisements