本文整理汇总了Python中org.apache.pig.scripting.Pig.registerJar方法的典型用法代码示例。如果您正苦于以下问题:Python Pig.registerJar方法的具体用法?Python Pig.registerJar怎么用?Python Pig.registerJar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.pig.scripting.Pig
的用法示例。
在下文中一共展示了Pig.registerJar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from org.apache.pig.scripting import Pig [as 别名]
# 或者: from org.apache.pig.scripting.Pig import registerJar [as 别名]
def __init__ (self, jars = [], properties = {}):
''' Initialize Pig. '''
for jar in jars:
logger.debug (" >>> register jar: %s", jar)
Pig.registerJar (jar)
for key in properties:
logger.debug (" >>> set property: %s => %s", key, properties[key])
Pig.set (key, properties [key])
示例2: pig_init
# 需要导入模块: from org.apache.pig.scripting import Pig [as 别名]
# 或者: from org.apache.pig.scripting.Pig import registerJar [as 别名]
def pig_init():
""" Setup the pig settings used for all runs."""
#I'm using the piggybank from s3://elasticmapreduce/libs/pig/0.9.1/piggybank-0.9.1-amzn.jar
Pig.registerJar('/usr/share/pig/contrib/piggybank/piggybank.jar')
Pig.define('DATE_TIME', 'org.apache.pig.piggybank.evaluation.datetime.DATE_TIME()')
Pig.define('EXTRACT', 'org.apache.pig.piggybank.evaluation.string.EXTRACT()')
Pig.define('FORMAT', 'org.apache.pig.piggybank.evaluation.string.FORMAT()')
Pig.define('FORMAT_DT', 'org.apache.pig.piggybank.evaluation.datetime.FORMAT_DT()')
Pig.define('REPLACE', 'org.apache.pig.piggybank.evaluation.string.REPLACE()')
#The box I use is dedicated to pig so use a lot of memory
Pig.set('pig.cachedbag.memusage', '0.6')