Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. Which of the following function is used to read data in PIG ?
  1.    WRITE
  2.    READ
  3.    LOAD
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> LOAD


PigStorage is the default load function.


Question 2. You can run Pig in interactive mode using the ______ shell.
  1.    Grunt
  2.    FS
  3.    HDFS
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> Grunt


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.


Question 3. The ________ class mimics the behavior of the Main class but gives users a statistics object back.
  1.    PigRun
  2.    PigRunner
  3.    RunnerPig
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> PigRunner


Optionally, you can call the API with an implementation of progress listener which will be invoked by Pig run time during the execution.


Question 4. __________ is a framework for collecting and storing script-level statistics for Pig Latin.
  1.    Pig Stats
  2.    PStatistics
  3.    Pig Statistics
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> Pig Statistics


The new Pig statistics and the existing Hadoop statistics can also be accessed via the Hadoop job history file.


Question 5. ___________ return a list of hdfs files to ship to distributed cache.
  1.    relativeToAbsolutePath()
  2.    setUdfContextSignature()
  3.    getCacheFiles()
  4.    getShipFiles()
 Discuss Question
Answer: Option D. -> getShipFiles()


The default implementation provided in LoadFunc handles this for FileSystem locations.


Question 6. The loader should use ______ method to communicate the load information to the underlying InputFormat.
  1.    relativeToAbsolutePath()
  2.    setUdfContextSignature()
  3.    getCacheFiles()
  4.    setLocation()
 Discuss Question
Answer: Option D. -> setLocation()


setLocation() method is called by Pig to communicate the load location to the loader.


Question 7. Which of the following file contains user defined functions (UDFs) ?
  1.    script2-local.pig
  2.    pig.jar
  3.    tutorial.jar
  4.    excite.log.bz2
 Discuss Question
Answer: Option C. -> tutorial.jar


tutorial.jar contains java classes also.


Question 8. Which of the following command can be used for debugging ?
  1.    exec
  2.    execute
  3.    error
  4.    throw
 Discuss Question
Answer: Option A. -> exec


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


Question 9. Which of the following script is used to check scripts that have failed jobs ?
  1.    a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate (Chararray) j#'STATUS' as status, j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'JOBNAME' as script_name, j#'JOBID' as job;c = filter b by status != 'SUCCESS';dump c;
  2.    a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'JOBNAME' as script_name, (Long) r#'NUMBER_REDUCES' as reduces;c = group b by (id, user, script_name) parallel 10;d = foreach c generate group.user, group.script_name, MAX(b.reduces) as max_reduces;e = filter d by max_reduces == 1;dump e; 
  3.    a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'QUEUE_NAME' as queue;c = group b by (id, user, queue) parallel 10;d = foreach c generate group.user, group.queue, COUNT(b);dump d;
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate (Chararray) j#'STATUS' as status, j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'JOBNAME' as script_name, j#'JOBID' as job;c = filter b by status != 'SUCCESS';dump c;


Pig provides the ability to register a listener to receive event notifications during the execution of a script.


Question 10. Which of the following code is used to find scripts that use only the default parallelism ?
  1.    a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate (Chararray) j#'STATUS' as status, j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'JOBNAME' as script_name, j#'JOBID' as job;c = filter b by status != 'SUCCESS';dump c;
  2.    a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'JOBNAME' as script_name, (Long) r#'NUMBER_REDUCES' as reduces;c = group b by (id, user, script_name) parallel 10;d = foreach c generate group.user, group.script_name, MAX(b.reduces) as max_reduces;e = filter d by max_reduces == 1;dump e; 
  3.    a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'QUEUE_NAME' as queue;c = group b by (id, user, queue) parallel 10;d = foreach c generate group.user, group.queue, COUNT(b);dump d;
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> a = load '/mapred/history/done' using HadoopJobHistoryLoader() as (j:map[], m:map[], r:map[]);b = foreach a generate j#'PIG_SCRIPT_ID' as id, j#'USER' as user, j#'JOBNAME' as script_name, (Long) r#'NUMBER_REDUCES' as reduces;c = group b by (id, user, script_name) parallel 10;d = foreach c generate group.user, group.script_name, MAX(b.reduces) as max_reduces;e = filter d by max_reduces == 1;dump e; 


The first map in the schema contains job-related entries.


Latest Videos

Latest Test Papers