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 ?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With