250+ TOP MCQs on Querying Data with HiveQL and Answers

Hadoop MCQs on “Querying Data with HiveQL – 2”.

1. Serialization of string columns uses a ________ to form unique column values.
a) Footer
b) STRIPES
c) Dictionary
d) Index

Answer: c
Clarification: The dictionary is sorted to speed up predicate filtering and improve compression ratios.

2. Point out the correct statement.
a) The Avro file dump utility analyzes ORC files
b) Streams are compressed using a codec, which is specified as a table property for all streams in that table
c) The ODC file dump utility analyzes ORC files
d) All of the mentioned

Answer: b
Clarification: The codec can be Snappy, Zlib, or none.

3. _______ is a lossless data compression library that favors speed over compression ratio.
a) LOZ
b) LZO
c) OLZ
d) All of the mentioned

Answer: a
Clarification: lzo and lzop need to be installed on every node in the Hadoop cluster.

4. Which of the following will prefix the query string with parameters?
a) SET hive.exec.compress.output=false
b) SET hive.compress.output=false
c) SET hive.exec.compress.output=true
d) All of the mentioned

Answer: a
Clarification: Use lzop command utility or your custom Java to generate .lzo.index for the .lzo files.

5. Point out the wrong statement.
a) TIMESTAMP is Only available starting with Hive 0.10.0
b) DECIMAL introduced in Hive 0.11.0 with a precision of 38 digits
c) Hive 0.13.0 introduced user definable precision and scale
d) All of the mentioned

Answer: b
Clarification: TIMESTAMP is available starting with Hive 0.8.0

6. Integral literals are assumed to be _________ by default.
a) SMALL INT
b) INT
c) BIG INT
d) TINY INT

  250+ TOP MCQs on Hadoop Ecosystem and Answers

Answer: b
Clarification: Integral literals are assumed to be INT by default, unless the number exceeds the range of INT in which case it is interpreted as a BIGINT, or if one of the following postfixes is present on the number.

7. Hive uses _____ style escaping within the strings.
a) C
b) Java
c) Python
d) Scala

Answer: a
Clarification: String literals can be expressed with either single quotes (‘) or double quotes (“).

8. Which of the following statement will create a column with varchar datatype?
a) CREATE TABLE foo (bar CHAR(10))
b) CREATE TABLE foo (bar VARCHAR(10))
c) CREATE TABLE foo (bar CHARVARYING(10))
d) All of the mentioned

Answer: b
Clarification: Varchar datatype was introduced in Hive 0.12.0

9. _________ will overwrite any existing data in the table or partition.
a) INSERT WRITE
b) INSERT OVERWRITE
c) INSERT INTO
d) None of the mentioned

Answer: c
Clarification: INSERT INTO will append to the table or partition, keeping the existing data intact.

10. Hive does not support literals for ______ types.
a) Scalar
b) Complex
c) INT
d) CHAR

Answer: b
Clarification: It is not possible to use them in INSERT INTO…VALUES clauses.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top