我试图使用文件中的Apache spark过滤掉特定文件的日期到RDD功能sc.textFile()
.
我试图做以下事情:
sc.textFile("/user/Orders/201507(2[7-9]{1}|3[0-1]{1})*")
Run Code Online (Sandbox Code Playgroud)
这应符合以下要求:
/user/Orders/201507270010033.gz
/user/Orders/201507300060052.gz
Run Code Online (Sandbox Code Playgroud)
知道怎么做到这一点?
我在 IntelliJ IDE 中运行 HbaseTestingUtility 时遇到问题,我可以看到以下错误可能是由于文件名太长造成的:
16/03/14 22:45:13 WARN datanode.DataNode: IOException in BlockReceiver.run():
java.io.IOException: Failed to move meta file for ReplicaBeingWritten, blk_1073741825_1001, RBW
getNumBytes() = 7
getBytesOnDisk() = 7
getVisibleLength()= 7
getVolume() = C:\Users\user1\Documents\work\Repos\hadoop-analys\reporting\mrkts-surveillance\target\test-data\9654a646-e923-488a-9e20-46396fd15292\dfscluster_6b264e6b-0218-4f30-ad5b-72e838940b1e\dfs\data\data1\current
getBlockFile() = C:\Users\user1\Documents\work\Repos\hadoop-analys\reporting\mrkts-surveillance\target\test-data\9654a646-e923-488a-9e20-46396fd15292\dfscluster_6b264e6b-0218-4f30-ad5b-72e838940b1e\dfs\data\data1\current\BP-429386217-192.168.1.110-1457991908038\current\rbw\blk_1073741825
bytesAcked=7
bytesOnDisk=7 from C:\Users\user1\Documents\work\Repos\hadoop-analys\reporting\mrkts-surveillance\target\test-data\9654a646-e923-488a-9e20-46396fd15292\dfscluster_6b264e6b-0218-4f30-ad5b-72e838940b1e\dfs\data\data1\current\BP-429386217-192.168.1.110-1457991908038\current\rbw\blk_1073741825_1001.meta to C:\Users\user1\Documents\work\Repos\hadoop-analys\reporting\mrkts-surveillance\target\test-data\9654a646-e923-488a-9e20-46396fd15292\dfscluster_6b264e6b-0218-4f30-ad5b-72e838940b1e\dfs\data\data1\current\BP-429386217-192.168.1.110-1457991908038\current\finalized\subdir0\subdir0\blk_1073741825_1001.meta
at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl.moveBlockFiles(FsDatasetImpl.java:615)
at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.BlockPoolSlice.addBlock(BlockPoolSlice.java:250)
at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsVolumeImpl.addBlock(FsVolumeImpl.java:229)
at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl.finalizeReplica(FsDatasetImpl.java:1119)
at org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetImpl.finalizeBlock(FsDatasetImpl.java:1100)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver$PacketResponder.finalizeBlock(BlockReceiver.java:1293)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver$PacketResponder.run(BlockReceiver.java:1233)
at java.lang.Thread.run(Thread.java:745)
Caused by: 3: The system cannot find the path specified.
Run Code Online (Sandbox Code Playgroud)
知道吗,我如何指定 Hbasetestingutility 的基目录而不使用这个庞大的起始目录?
谢谢,
我使用在bash脚本中指定的spark-submit为:
CLUSTER_OPTIONS=" \
--master yarn-cluster \
--files file:///${CONF_DIR}/app.conf#app.conf,file:///${CONF_DIR}/log4j-executor.xml#log4j.xml \
--conf "spark.executor.extraJavaOptions=-Dlog4j.configuration=file:log4j.xml" \
--driver-java-options '-Dlog4j.configuration=file:log4j.xml -Dconfig.file=app.conf' \
--keytab ${KEYTAB} \
--principal ${PRINCIPAL} \
"
Run Code Online (Sandbox Code Playgroud)
我收到此错误消息时发现应用程序配置文件没有被提取:
Error: Unrecognized option: -Dconfig.file=file:app.conf'
Run Code Online (Sandbox Code Playgroud)
我还尝试了不同的方法来封装driver-java-options:
1)
--driver-java-options \"-Dlog4j.configuration=file:log4j.xml -Dconfig.file=app.conf\" \
Error: Unrecognized option: -Dconfig.file=file:app.conf"
Run Code Online (Sandbox Code Playgroud)
2)
--driver-java-options "-Dlog4j.configuration=file:log4j.xml -Dconfig.file=file:transformation.conf" \
./start_app.sh: line 30: -Dconfig.file=file:app.conf --keytab /app/conf/keytab/principal.keytab --principal principal : No such file or directory
Run Code Online (Sandbox Code Playgroud)
如何指定供我的Spark应用程序使用的多个driver-java-options?
注意我正在使用Spark 1.5.0
有没有办法在保持原始创建/修改/读取时间的同时重命名文件?这是在 Solaris 中。
提前致谢。
写一个简单的bash脚本在早上为我做一些检查:一部分是拉下一些html文件并确保它们存在.另一部分是确保存在一些本地文件,如果不存在则通过电子邮件发送.我面临的问题是我收到了"语法错误:意外的文件结束",我无法理解为什么会发生这种错误.这是代码的简化版本:
for myHost in $HOSTS
do
result=$(wget -T $TIMEOUT -t 1 $myHost -O /dev/null -o /dev/stdout)
result2=$(echo $result | grep "awaiting response")
connected=$(echo $result | grep "404");
if [ "$connected" != "" ]; then
for myEMAIL in $EMAIL
do
echo -e "$(date) - $myHost is down! \n This is an automated message." | mailx -r "box.email.com" -s "$SUBJECT" $myEMAIL
done
fi
done
numoffiles=`find . -maxdepth 1 -mtime -1 | grep -i .html | wc -l`
if [ "$numoffiles" -ne 5 …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在使用spark时获得特定获胜拍卖时间周围的拍卖列表的过滤列表.获胜拍卖RDD和完整拍卖DD由案例类组成,格式如下:
case class auction(id: String, prodID: String, timestamp: Long)
我想在相同的产品ID上过滤在中奖拍卖的10秒内拍卖的完整拍卖RDD,并获得充满这些的RDD.
我试图像这样过滤它:
val specificmessages = winningauction.map(it =>
allauctions.filter( x =>
x.timestamp > it.timestamp - 10 &&
x.timestamp < it.timestamp + 10 &&
x.productID == it.productID
)
)
Run Code Online (Sandbox Code Playgroud)
有没有办法执行此操作,因为嵌套转换是不可能的?
还有另一个答案,但这主要涉及嵌套地图SPARK-5603嵌套地图功能
apache-spark ×3
scala ×3
bash ×2
file-rename ×1
hbase ×1
heredoc ×1
rdd ×1
solaris ×1
string ×1
syntax-error ×1
unix ×1
windows ×1