Apache Pig is no longer used. So with Yauaa 7 this UDF has been dropped.
Version 6.12 is the last released version which still has the Apache Pig in it.
-- Import the UDF jar file so this script can use itREGISTER../target/*-udf.jar;
-------------------------------------------------------------------------- Define a more readable name for the UDF and pass optional parameters-- First parameter is ALWAYS the cache size (as a text string!)-- The parameters after that are the requested fields.------------ If you simply want 'everything'-- DEFINE ParseUserAgent nl.basjes.parse.useragent.pig.ParseUserAgent;------------ If you just want to set the cache-- DEFINE ParseUserAgent nl.basjes.parse.useragent.pig.ParseUserAgent('10000');------------ If you want to set the cache and only retrieve the specified fieldsDEFINE ParseUserAgent nl.basjes.parse.useragent.pig.ParseUserAgent('10000','DeviceClass','DeviceBrand' );
rawData =LOAD'testcases.txt'USING PigStorage()
AS ( useragent: chararray );
UaData =FOREACH rawData
GENERATE useragent,
-- Do NOT specify a type for this field as the UDF provides the definitionsParseUserAgent(useragent) AS parsedAgent;