apache pig - Pig If Else semantics -


i have like

a = load 'input-1'; b = load 'input-2'; c = union a,b; 

where input-1 directory , may empty. whenever empty, union throws exception null. union 1 operation here, other operation join $0, b $0, etc.

is possible check nullness of "a" in pig, before using sub sequent operation ?

you need pre-process inputs using split function. there no if/else semantics in pig, unfortunately.

a = load 'input-1'; b = load 'input-2';  split a_clean if ($0 not null), a_dirty if ($0 null); split b b_clean if ($0 not null), b_dirty if ($0 null);  c = union a_clean, b_clean; 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -