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