250+ TOP MCQs on Data Processing Operators in Pig and Answers

Hadoop Multiple Choice Questions on “Data Processing Operators in Pig”.

1. Which of the following is shortcut for DUMP operator?
a) de alias
b) d alias
c) q
d) None of the mentioned

Answer: b
Clarification: If alias is ignored last defined alias will be used.

2. Point out the correct statement.
a) Invoke the Grunt shell using the “enter” command
b) Pig does not support jar files
c) Both the run and exec commands are useful for debugging because you can modify a Pig script in an editor
d) All of the mentioned

Answer: c
Clarification: Both commands promote Pig script modularity as they allow you to reuse existing components.

3. Which of the following command is used to show values to keys used in Pig?
a) set
b) declare
c) display
d) all of the mentioned

Answer: a
Clarification: All Pig and Hadoop properties can be set, either in the Pig script or via the Grunt command line.

4. Use the __________ command to run a Pig script that can interact with the Grunt shell (interactive mode).
a) fetch
b) declare
c) run
d) all of the mentioned

Answer: c
Clarification: With the run command, every store triggers execution.

5. Point out the wrong statement.
a) You can run Pig scripts from the command line and from the Grunt shell
b) DECLARE defines a Pig macro
c) Use Pig scripts to place Pig Latin statements and Pig commands in a single file
d) None of the mentioned

Answer: b
Clarification: DEFINE defines a Pig macro.

6. Which of the following command can be used for debugging?
a) exec
b) execute
c) error
d) throw

Answer: a
Clarification: With the exec command, store statements will not trigger execution; rather, the entire script is parsed before execution starts.

7. Which of the following file contains user defined functions (UDFs)?
a) script2-local.pig
b) pig.jar
c) tutorial.jar
d) excite.log.bz2

Answer: c
Clarification: tutorial.jar contains java classes also.

8. Which of the following is correct syntax for parameter substitution using cmd?
a) pig {-param param_name = param_value | -param_file file_name} [-debug | -dryrun] script
b) {%declare | %default} param_name param_value
c) {%declare | %default} param_name param_value cmd
d) All of the mentioned

Answer: a
Clarification: Parameter Substitution is used to substitute values for parameters at run time.

9. You can specify parameter names and parameter values in one of the ways?
a) As part of a command line.
b) In parameter file, as part of a command line
c) With the declare statement, as part of Pig script
d) All of the mentioned

Answer: d
Clarification: Parameter substitution may be used inside of macros.

10. _________ are scanned in the order they are specified on the command line.
a) Command line parameters
b) Parameter files
c) Declare and default preprocessors
d) Both parameter files and command line parameters

Answer: d
Clarification: Parameters and command parameters are scanned in FIFO manner.

Leave a Reply

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