Chhaya Vishwakarma
Chhaya Vishwakarma

Reputation: 1437

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 ?

Upvotes: 6

Views: 20963

Answers (1)

Debaditya
Debaditya

Reputation: 2497

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

Upvotes: 11

Related Questions