0

With Hadoop 2.2 installed on single node I try to run Scalding tutorial, part 1, with command:

$ yarn jar target/scalding-tutorial-0.8.11.jar Tutorial0 --hdfs

https://github.com/Cascading/scalding-tutorial/

Before running tutorial I Have copied required file hello.txt to HDFS:

$ hdfs dfs -ls /data
Found 2 items
drwxr-xr-x   - hdfs hdfs          0 2014-02-04 16:35 /data/10gsort
-rw-r--r--   3 hdfs hdfs         26 2014-07-03 15:07 /data/hello.txt

It looks like tutorial can not find input file:

Exception in thread "main" com.twitter.scalding.InvalidSourceException:[TextLine(data/hello.txt)] Data is missing from one or more paths in: List(data/hello.txt)
at com.twitter.scalding.FileSource.validateTaps(FileSource.scala:102)
at com.twitter.scalding.Job$$anonfun$validateSources$1.apply(Job.scala:158)
at com.twitter.scalding.Job$$anonfun$validateSources$1.apply(Job.scala:153)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1156)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at com.twitter.scalding.Job.validateSources(Job.scala:153)
at com.twitter.scalding.Job.buildFlow(Job.scala:91)
at com.twitter.scalding.Job.run(Job.scala:126)
at com.twitter.scalding.Tool.start$1(Tool.scala:109)
at com.twitter.scalding.Tool.run(Tool.scala:125)
at com.twitter.scalding.Tool.run(Tool.scala:72)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at JobRunner$.main(JobRunner.scala:27)
at JobRunner.main(JobRunner.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

Any ideas how to make it work?

4

1 回答 1

0

TextLine 原来是根据给定的路径和配置构建 Hadoop 路径。

Hadoop 路径 API显示“如果路径字符串以斜杠开头,则它是绝对的。”

教程我将输入固定为“data/hello.txt”,它实际上以相对路径结束。当前工作目录将被添加以形成绝对且可靠的路径。

于 2015-09-17T23:19:04.483 回答