PIG Interview and Exam Questions

 

PIG Interview / Exam Questions Cheat sheet



  • Question: Command to view list of aliases in pig? 
    • Answer: grunt> aliases

  • Question: Command view list of files in pig?
    • Answer: grunt> ls <schema>

  • Question: Command to view tuples from a file?
    • Answer: grunt> DUMP <schema>

  • Question: Command to view bags grouped with tuple in pig? 
    • Answer: grunt>  <schema> = GROUP file by column;   ##"Tuples are displayed in parenthesis and bags are displayed in curly braces."

  • Question: Command tos end output to a folder in hdfs using pig?
    • Answer: STORE schema INTO 'folder'

  • Question: Command to describe relations in a file in  pig?
    • Answer: Describe <schema>

  • Question: Define bags in pig?
    • Answer: A bag is an unordered collection of tuples.

  • Question: How to define relation using schema?
    • Answer: grunt> <schema> = LOAD 'file.txt' AS (col1,col2);

  • Question: How to start pig ?
    • Answer: use command "Pig", this will open grunt shell to enter pig commands.

No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services