问题描述
尝试运行Apache Beam(2.0版)的 WordCount 示例. 0)首先运行
Trying to run WordCount example of Apache Beam (version 2.0.0) by first running
$ mvn archetype:generate \
-DarchetypeGroupId=org.apache.beam \
-DarchetypeArtifactId=beam-sdks-java-maven-archetypes-examples \
-DarchetypeVersion=2.0.0 \
-DgroupId=org.example \
-DartifactId=word-count-beam \
-Dversion="0.1" \
-Dpackage=org.apache.beam.examples \
-DinteractiveMode=false
然后运行
$ mvn compile exec:java -Dexec.mainClass=org.apache.beam.examples.WordCount -Dexec.args="--inputFile=pom.xml --output=counts" -Pdirect-runner
并出现以下错误
但是,如果我运行的是2017年3月下载并构建的同一项目(Beam v0.6.0),则一切正常.我只是想知道Beam发行版的哪些更新会导致此错误.
However, if I run the same project downloaded and built in Mar 2017 (Beam v0.6.0), everything works fine. I just wonder what update of the Beam release causes this error.
推荐答案
发生此错误是由于 TextIO#from("path_to_file")方法不支持Windows文件系统路径.例如,以下代码引发 IllegalStateException :
This error happens due to TextIO#from("path_to_file") method doesn't support Windows file system paths.For example the following code throws IllegalStateException:
TextIO.read().from("d:\\file.txt") // also "file:\\D:\\file.txt" throw exc
我希望Apache Beam团队会在不久的将来对其进行修复...
I hope that Apache Beam team will fix it in near future...
这篇关于Windows中的Apache Beam WordCount运行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!