本文整理汇总了Python中org.apache.pig.scripting.Pig.getParameters方法的典型用法代码示例。如果您正苦于以下问题:Python Pig.getParameters方法的具体用法?Python Pig.getParameters怎么用?Python Pig.getParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.pig.scripting.Pig
的用法示例。
在下文中一共展示了Pig.getParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: float
# 需要导入模块: from org.apache.pig.scripting import Pig [as 别名]
# 或者: from org.apache.pig.scripting.Pig import getParameters [as 别名]
from org.apache.pig.scripting import Pig
from pagerank_lib import Pagerank
if __name__ == "__main__":
params = Pig.getParameters()
try:
input_path = params["INPUT_PATH"]
output_path = params["OUTPUT_PATH"]
tmp_output_dir = params["TMP_OUTPUT_DIR"]
except:
print "Usage: mortar baconbits:[local_]run pagerank " + "-p INPUT_PATH=<...> -p OUTPUT_PATH=<...> -p TMP_OUTPUT_DIR=<...> "
damping_factor = 0.85
if "DAMPING_FACTOR" in params:
damping_factor = float(params["DAMPING_FACTOR"])
convergence_threshold = 0.001
if "CONVERGENCE_THRESHOLD" in params:
convergence_threshold = float(params["CONVERGENCE_THRESHOLD"])
max_num_iterations = 10
if "MAX_NUM_ITERATIONS" in params:
max_num_iterations = int(params["MAX_NUM_ITERATIONS"])
id_name_map = None
if "ID_NAME_MAP" in params:
id_name_map = params["ID_NAME_MAP"]
Pagerank.run_pagerank(
input_path,