to do
python UDFs (the language my students actually know...), you will need to
use an older version of Pig. To be fair, I haven't checked 14 or 15...but
16 forward don't appear to be a great plan.
hth,
mew
On Wed, Oct 30, 2024 at 4:07 PM Mark Woodcock wrote:
> pig-0.17.0bin/pig
is wrong,
or b) that a path that started with a single-quote did not yield a valid
python file or c) anything understandable instead of getting in the middle
of the M/R computation and throwing wacky (mkey? nullPointer) errors.
On Wed, Oct 30, 2024 at 4:12 PM Mark Woodcock wrote:
> pig-0.17.
pig-0.17.0bin/pig -x local
very basic UDF file:
#!/usr/bin/python3
from pig_util import outputSchema
@outputSchema("as:int")
def square(num):
if num == None:
return None
return ((num) * (num))
@outputSchema("word:chararray")
def concat(word):
return word + word
Exceedingly simple pig script: