Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Declaring a variable and schema in PIG

how to declare a variable in PIG? suppose i want to have a integer to have values as 10 how can i declare it in script? and how schema can be reused ?

like image 703
chhaya vishwakarma Avatar asked Jan 31 '12 06:01

chhaya vishwakarma


1 Answers

I think you can use the 'Declare' command. It is used to describe one parameter and is used within the PIG script.

    %declare DESC 'Database'
    A = load 'data' as (name, desc);
    B = FILTER A by desc eq '$DESC';
    .....

You can get more about it here. Pig Parameter

like image 120
Debaditya Avatar answered Sep 30 '22 15:09

Debaditya