Hadoop Questions and Answers – Data Processing Operators in Pig

This set of Hadoop Multiple Choice Questions & Answers (MCQs) focuses 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
View Answer

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

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

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

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

advertisement
advertisement

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

Answer: b
Explanation: DEFINE defines a Pig macro.

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

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

Note: Join free Sanfoundry classes at Telegram or Youtube

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

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

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

advertisement

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

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

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

advertisement

Sanfoundry Global Education & Learning Series – Hadoop.

Here’s the list of Best Books in Hadoop.

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.