【发布时间】:2014-07-04 02:45:37
【问题描述】:
我正在尝试在 Spark 上运行一些转换,它在集群(YARN、linux 机器)上运行良好。 但是,当我尝试在本地机器 (Windows 7) 上进行单元测试时,出现错误:
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.
at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:318)
at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:333)
at org.apache.hadoop.util.Shell.<clinit>(Shell.java:326)
at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76)
at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:93)
我的代码如下:
@Test
def testETL() = {
val conf = new SparkConf()
val sc = new SparkContext("local", "test", conf)
try {
val etl = new IxtoolsDailyAgg() // empty constructor
val data = sc.parallelize(List("in1", "in2", "in3"))
etl.etl(data) // rdd transformation, no access to SparkContext or Hadoop
Assert.assertTrue(true)
} finally {
if(sc != null)
sc.stop()
}
}
它为什么要尝试访问 hadoop?我该如何解决? 提前谢谢你
【问题讨论】:
标签: unit-testing hadoop apache-spark