本文整理汇总了Python中tests.mr_two_step_job.MRTwoStepJob.HADOOP_OUTPUT_FORMAT方法的典型用法代码示例。如果您正苦于以下问题:Python MRTwoStepJob.HADOOP_OUTPUT_FORMAT方法的具体用法?Python MRTwoStepJob.HADOOP_OUTPUT_FORMAT怎么用?Python MRTwoStepJob.HADOOP_OUTPUT_FORMAT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.mr_two_step_job.MRTwoStepJob
的用法示例。
在下文中一共展示了MRTwoStepJob.HADOOP_OUTPUT_FORMAT方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hadoop_output_format
# 需要导入模块: from tests.mr_two_step_job import MRTwoStepJob [as 别名]
# 或者: from tests.mr_two_step_job.MRTwoStepJob import HADOOP_OUTPUT_FORMAT [as 别名]
def test_hadoop_output_format(self):
output_format = "org.apache.hadoop.mapred.SequenceFileOutputFormat"
# one-step job
job1 = MRWordCount()
# no cmd-line argument for this because it's part of job semantics
job1.HADOOP_OUTPUT_FORMAT = output_format
with job1.make_runner() as runner1:
self.assertEqual(runner1._hadoop_args_for_step(0), ["-outputformat", output_format])
# multi-step job: only use -outputformat on the last step
job2 = MRTwoStepJob()
job2.HADOOP_OUTPUT_FORMAT = output_format
with job2.make_runner() as runner2:
self.assertEqual(runner2._hadoop_args_for_step(0), [])
self.assertEqual(runner2._hadoop_args_for_step(1), ["-outputformat", output_format])