250+ TOP MCQs on Introduction to Pig and Answers

Questions and Answers on “Introduction to Pig”.

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

Answer: a
Clarification: 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

Answer: a
Clarification: 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

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

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

Answer: d
Clarification: 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

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

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

Answer: c
Clarification: 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

Answer: a
Clarification: 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.

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

Answer: a
Clarification: 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

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

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

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

Leave a Reply

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