Hadoop Questions and Answers – Introduction to Hive

This set of Hadoop Multiple Choice Questions & Answers (MCQs) focuses on “Introduction to Hive”.

1. Which of the following command sets the value of a particular configuration variable (key)?
a) set -v
b) set <key>=<value>
c) set
d) reset
View Answer

Answer: b
Explanation: If you misspell the variable name, the CLI will not show an error.

2. Point out the correct statement.
a) Hive Commands are non-SQL statement such as setting a property or adding a resource
b) Set -v prints a list of configuration variables that are overridden by the user or Hive
c) Set sets a list of variables that are overridden by the user or Hive
d) None of the mentioned
View Answer

Answer: a
Explanation: Commands can be used in HiveQL scripts or directly in the CLI or Beeline.

3. Which of the following operator executes a shell command from the Hive shell?
a) |
b) !
c) ^
d) +
View Answer

Answer: b
Explanation: Exclamation operator is for execution of command.

advertisement
advertisement

4. Which of the following will remove the resource(s) from the distributed cache?
a) delete FILE[S] <filepath>*
b) delete JAR[S] <filepath>*
c) delete ARCHIVE[S] <filepath>*
d) all of the mentioned
View Answer

Answer: d
Explanation: Delete command is used to remove existing resource.

5. Point out the wrong statement.
a) source FILE <filepath> executes a script file inside the CLI
b) bfs <bfs command> executes a dfs command from the Hive shell
c) hive is Query language similar to SQL
d) none of the mentioned
View Answer

Answer: b
Explanation: dfs <dfs command> executes a dfs command from the Hive shell.

Note: Join free Sanfoundry classes at Telegram or Youtube

6. _________ is a shell utility which can be used to run Hive queries in either interactive or batch mode.
a) $HIVE/bin/hive
b) $HIVE_HOME/hive
c) $HIVE_HOME/bin/hive
d) All of the mentioned
View Answer

Answer: c
Explanation: Various types of command line operations are available in the shell utility.

7. Which of the following is a command line option?
a) -d,–define <key=value>
b) -e,–define <key=value>
c) -f,–define <key=value>
d) None of the mentioned
View Answer

Answer: a
Explanation: Variable substitution to apply to hive commands. e.g. -d A=B or –define A=B.

advertisement

8. Which is the additional command line option is available in Hive 0.10.0?
a) –database <dbname>
b) –db <dbname>
c) –dbase <<dbname>
d) All of the mentioned
View Answer

Answer: a
Explanation: Database is specified which is to be used.

9. The CLI when invoked without the -i option will attempt to load $HIVE_HOME/bin/.hiverc and $HOME/.hiverc as _______ files.
a) processing
b) termination
c) initialization
d) none of the mentioned
View Answer

Answer: c
Explanation: Hiverc file is loaded as per options selected.

advertisement

10. When $HIVE_HOME/bin/hive is run without either the -e or -f option, it enters _______ mode.
a) Batch
b) Interactive shell
c) Multiple
d) None of the mentioned
View Answer

Answer: b
Explanation: Use “;” (semicolon) to terminate commands for multiple options available.

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.