本文整理汇总了Python中org.apache.pig.scripting.Pig.registerUDF方法的典型用法代码示例。如果您正苦于以下问题:Python Pig.registerUDF方法的具体用法?Python Pig.registerUDF怎么用?Python Pig.registerUDF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.pig.scripting.Pig
的用法示例。
在下文中一共展示了Pig.registerUDF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: from org.apache.pig.scripting import Pig [as 别名]
# 或者: from org.apache.pig.scripting.Pig import registerUDF [as 别名]
par = {}
par['DATA_DATE'] = day
par['REPORT_DATE'] = "2013/07/" + str(i)
params.append(par)
prefix = "2013080"
for i in range(1, 10):
day = prefix + str(i)
par = {}
par['DATA_DATE'] = day
par['REPORT_DATE'] = "2013/08/0" + str(i)
params.append(par)
Pig.registerUDF("attribute_click.py", "myfuncs")
# ('date.range','start.date=$DATE;end.date=$DATE;error.on.missing=false');
script = """
%declare OUTPUT '/user/haliu'
member = load '$OUTPUT/JYMBII-batch/MemberList' USING BinaryJSON();
events = LOAD '/data/tracking/PageViewEvent' USING LiAvroStorage('date.range','start.date=$DATA_DATE;end.date=$DATA_DATE;error.on.missing=false');
job_view_events = FILTER events BY requestHeader.pageKey == 'jobs_seeking_view_job' AND header.memberId > 0;
job_views = FOREACH job_view_events GENERATE
(int)header.memberId AS memberId,
(long)header.time AS time,
trackingCode,
(int)trackingInfo#'0' AS jobId;