running
pig -x local -dryrun dryrun_test.pig
on this file:
--------------
DEFINE test_macro() RETURNS return_value {
unfiltered = LOAD 'data' USING PigStorage(',');  --(0,1,2,3,4,5,6,7,8,9);
$return_value = FILTER unfiltered BY
$0 IS NOT NULL AND $1 IS NOT NULL AND $2 IS NOT NULL AND $3 IS NOT NULL AND
$4 IS NOT NULL AND $5 IS NOT NULL AND $6 IS NOT NULL AND $7 IS NOT NULL;
};

test_result = test_macro();
DUMP test_result;
STORE test_result INTO 'test_result' USING PigStorage('\t');
________

results in the following expanded file:
________
macro_test_macro_unfiltered_0 = LOAD 'data' USING PigStorage(',');
test_result = FILTER macro_test_macro_unfiltered_0 BY (((((((($0 IS NOT
NULL) AND ($1 IS NOT NULL)) AND ($2 IS NOT NULL)) AND ($3 IS NOT NULL)) AND
($4 IS NOT NULL)) AND ($5 IS NOT NULL)) AND ($6 IS NOT NULL)) AND ($7 IS
NOT NULL));
dump test_result
STORE test_result INTO 'test_result' USING PigStorage('\t');
_______

Note the extra nesting:  ((((((((

In my actual script, the filter has even more parameters, and the nesting
gets very deep.
Is there a way that I could set up my filter to avoid this?

Thanks,
John

Reply via email to