Hadoop Questions and Answers – Querying Data with HiveQL – 1

This set of Interview Questions & Answers focuses on “Querying Data with HiveQL – 1”.

1. Avro-backed tables can simply be created by using _________ in a DDL statement.
a) “STORED AS AVRO”
b) “STORED AS HIVE”
c) “STORED AS AVROHIVE”
d) “STORED AS SERDE”
View Answer

Answer: a
Explanation: AvroSerDe takes care of creating the appropriate Avro schema from the Hive table schema.

2. Point out the correct statement.
a) Avro Fixed type should be defined in Hive as lists of tiny ints
b) Avro Bytes type should be defined in Hive as lists of tiny ints
c) Avro Enum type should be defined in Hive as strings
d) All of the mentioned
View Answer

Answer: b
Explanation: The AvroSerde will convert these to Bytes during the saving process.

3. Types that may be null must be defined as a ______ of that type and Null within Avro.
a) Union
b) Intersection
c) Set
d) All of the mentioned
View Answer

Answer: a
Explanation: A null in a field that is not so defined will result in an exception during the save. No changes need be made to the Hive schema to support this, as all fields in Hive can be null.

4. The files that are written by the _______ job are valid Avro files.
a) Avro
b) Map Reduce
c) Hive
d) All of the mentioned
View Answer

Answer: c
Explanation: If you copy these files out, you’ll likely want to rename them with .avro.

advertisement
advertisement

5. Point out the wrong statement.
a) To create an Avro-backed table, specify the serde as org.apache.hadoop.hive.serde2.avro.AvroSerDe
b) Avro-backed tables can be created in Hive using AvroSerDe
c) The AvroSerde cannot serialize any Hive table to Avro files
d) None of the mentioned
View Answer

Answer: c
Explanation: The AvroSerde can serialize any Hive table to Avro files.

6. Use ________ and embed the schema in the create statement.
a) schema.literal
b) schema.lit
c) row.literal
d) all of the mentioned
View Answer

Answer: a
Explanation: You can embed the schema directly into the create statement.

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

7. _______ is interpolated into the quotes to correctly handle spaces within the schema.
a) $SCHEMA
b) $ROW
c) $SCHEMASPACES
d) $NAMESPACES
View Answer

Answer: a
Explanation: Use none to ignore either avro.schema.literal or avro.schema.url.

8. To force Hive to be more verbose, it can be started with ___________
a) *hive –hiveconf hive.root.logger=INFO,console*
b) *hive –hiveconf hive.subroot.logger=INFO,console*
c) *hive –hiveconf hive.root.logger=INFOVALUE,console*
d) All of the mentioned
View Answer

Answer: a
Explanation: This Statement will spit orders of magnitude more information to the console and will likely include any information the AvroSerde is trying to get you about what went wrong.

advertisement

9. ________ was designed to overcome limitations of the other Hive file formats.
a) ORC
b) OPC
c) ODC
d) None of the mentioned
View Answer

Answer: a
Explanation: The Optimized Row Columnar (ORC) file format provides a highly efficient way to store Hive data.

10. An ORC file contains groups of row data called __________
a) postscript
b) stripes
c) script
d) none of the mentioned
View Answer

Answer: b
Explanation: The default stripe size is 250 MB. Large stripe sizes enable large, efficient reads from HDFS.

advertisement

Sanfoundry Global Education & Learning Series – Hadoop.

Here’s the list of Best Books in Hadoop.

To practice all interview questions and answers on Hive, here is complete set of 1000+ Multiple Choice Questions and Answers.

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.