【问题标题】:Run spark unit test on Windows在 Windows 上运行 spark 单元测试
【发布时间】: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


    【解决方案1】:
    猜你喜欢
    • 2017-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-30
    • 1970-01-01
    • 1970-01-01
    • 2012-11-28
    相关资源
    最近更新 更多