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>
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
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 ?
Explanation: Excalamation operator is for execution of command.
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
Explanation: Delete command is used to remove existing resource.
5. Point out the wrong statement :
a) source FILE
c) hive is Query lanaguage similar to SQL
d) none of the mentioned
6. _________ is a shell utility which can be used to run Hive queries in either interactive or batch mode.
d) All of the mentioned
Explanation: Various types of command line operations are available in the shell utilty.
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
Explanation: Variable substitution to apply to hive commands. e.g. -d A=B or –define A=B.
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 [expand title="View Answer"]Answer: a Explanation: Database is specified which is to be used.[/expand] 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 [expand title="View Answer"]Answer: c Explanation: Hiverc file is loaded as per options selected.[/expand] 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 [expand title="View Answer"]Answer: b Explanation: Use ";" (semicolon) to terminate commands for multiple options available.[/expand] Sanfoundry Global Education & Learning Series – Hadoop.