Hadoop Questions and Answers – Introduction to Pig

This set of Questions and Answers focuses on “Introduction to Pig”.

1. Pig operates in mainly how many nodes?
a) Two
b) Three
c) Four
d) Five
View Answer

Answer: a
Explanation: You can run Pig (execute Pig Latin statements and Pig commands) using various mode: Interactive and Batch Mode.

2. Point out the correct statement.
a) You can run Pig in either mode using the “pig” command
b) You can run Pig in batch mode using the Grunt shell
c) You can run Pig in interactive mode using the FS shell
d) None of the mentioned
View Answer

Answer: a
Explanation: You can run Pig in either mode using the “pig” command (the bin/pig Perl script) or the “java” command (java -cp pig.jar …).

3. You can run Pig in batch mode using __________
a) Pig shell command
b) Pig scripts
c) Pig options
d) All of the mentioned
View Answer

Answer: b
Explanation: Pig script contains Pig Latin statements.

advertisement
advertisement

4. Pig Latin statements are generally organized in one of the following ways?
a) A LOAD statement to read data from the file system
b) A series of “transformation” statements to process the data
c) A DUMP statement to view results or a STORE statement to save the results
d) All of the mentioned
View Answer

Answer: d
Explanation: A DUMP or STORE statement is required to generate output.

5. Point out the wrong statement.
a) To run Pig in local mode, you need access to a single machine
b) The DISPLAY operator will display the results to your terminal screen
c) To run Pig in mapreduce mode, you need access to a Hadoop cluster and HDFS installation
d) All of the mentioned
View Answer

Answer: b
Explanation: The DUMP operator will display the results to your terminal screen.

Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which of the following function is used to read data in PIG?
a) WRITE
b) READ
c) LOAD
d) None of the mentioned
View Answer

Answer: c
Explanation: PigStorage is the default load function.

7. You can run Pig in interactive mode using the ______ shell.
a) Grunt
b) FS
c) HDFS
d) None of the mentioned
View Answer

Answer: a
Explanation: Invoke the Grunt shell using the “pig” command (as shown below) and then enter your Pig Latin statements and Pig commands interactively at the command line.

advertisement

8. Which of the following is the default mode?
a) Mapreduce
b) Tez
c) Local
d) All of the mentioned
View Answer

Answer: a
Explanation: To run Pig in mapreduce mode, you need access to a Hadoop cluster and HDFS installation.

9. Which of the following will run pig in local mode?
a) $ pig -x local …
b) $ pig -x tez_local …
c) $ pig …
d) None of the mentioned
View Answer

Answer: a
Explanation: Specify local mode using the -x flag (pig -x local).

advertisement

10.$ pig -x tez_local … will enable ________ mode in Pig.
a) Mapreduce
b) Tez
c) Local
d) None of the mentioned
View Answer

Answer: d
Explanation: Tez Local Mode is similar to local mode, except internally Pig will invoke tez runtime engine.

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.