Engineering Questions with Answers - Multiple Choice Questions

MCQs on Data Processing Operators in Pig

1 - Question

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 - Question

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 - Question

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 - Question

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.




5 - Question

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 - Question

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.




7 - Question

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 - Question

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.




9 - Question

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 - Question

_________ 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.

Get weekly updates about new MCQs and other posts by joining 18000+ community of active learners