Hadoop Questions and Answers – Querying Data with HiveQL – 2

This set of Hadoop MCQs focuses 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: a
Explanation: 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
View Answer

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

advertisement
advertisement

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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: b
Explanation: 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.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: a
Explanation: 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
View Answer

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

advertisement

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
View Answer

Answer: c
Explanation: 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
View Answer

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

advertisement

Sanfoundry Global Education & Learning Series – Hadoop.

Here’s the list of Best Books in Hadoop.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.