Search

Showing posts with label PIG. Show all posts
Showing posts with label PIG. Show all posts

why should we use ‘orderby’ keyword in pig scripts?



 The order statement sorts your data for you, producing a total order of your output data.The syntax of order is similar to group. You indicate a key or set of keys by which you wish to order your data
input2 = load ‘daily’ as (exchanges, stocks);
grpds = order input2 by exchanges;

why should we use ‘filters’ in pig scripts?



Filters are similar to where clause in SQL.filter which contain predicate.If that predicate evaluates to true for a given record, that record will be passed down the pipeline. Otherwise, it will not.predicate contain different operators like ==,>=,<=,!=.so,== and != can be applied to maps and tuples.
A= load ‘inputs’ as(name,address)
B=filter A by symbol matches ‘CM.*’;

What are the different Relational Operators available in pig language?



Relational operators in pig can be categorized into the following list

  • Loading and Storing
  • Filtering
  • Grouping and joining
  • Sorting
  • Combining and Splitting
  • Diagnostic

what are relational operations in pig latin?


they are
1 for each
2 order by
3 filters
4 group
5 distinct
6 join
7 limit

What is grunt shell?

Pig interactive shell is known as Grunt Shell. It provides a shell for users to interact with HDFS.

Does Pig give any warning when there is a type mismatch or missing field?


No, Pig will not show any warning if there is no matching field or a mismatch. If you assume that Pig gives such a warning, then it is difficult to find in log file. If any mismatch is found, it assumes a null value in Pig.

What is the purpose of ‘dump’ keyword in pig?



dump display the output on the screen
dump ‘processed’