2022-04-05 11:29:30 WARN FileInputDStream:87 - Error finding new files java.lang.NullPointerException at scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:192) at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:192) at scala.collection.SeqLike$class.size(SeqLike.scala:106) at scala.collection.mutable.ArrayOps$ofRef.size(ArrayOps.scala:186) at scala.collection.mutable.Builder$class.sizeHint(Builder.scala:69) at scala.collection.mutable.ArrayBuilder.sizeHint(ArrayBuilder.scala:22) at scala.collection.TraversableLike$class.builder$1(TraversableLike.scala:230) at scala.collection.TraversableLike$class.map(TraversableLike.scala:233) at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:186) at org.apache.spark.streaming.dstream.FileInputDStream.findNewFiles(FileInputDStream.scala:206) at org.apache.spark.streaming.dstream.FileInputDStream.compute(FileInputDStream.scala:149) at org.apache.spark.streaming.dstream.DStream anonfun$getOrCompute$1 anonfun$1 anonfun$apply$7.apply(DStream.scala:342)atorg.apache.spark.streaming.dstream.DStream anonfun$getOrCompute$1 anonfun$1 anonfun$apply$7.apply(DStream.scala:342) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58) at org.apache.spark.streaming.dstream.DStream anonfun$getOrCompute$1 anonfun$1.apply(DStream.scala:341) at org.apache.spark.streaming.dstream.DStream anonfun$getOrCompute$1 anonfun$1.apply(DStream.scala:341) at org.apache.spark.streaming.dstream.DStream.createRDDWithLocalProperties(DStream.scala:416) at org.apache.spark.streaming.dstream.DStream anonfun$getOrCompute$1.apply(DStream.scala:336)atorg.apache.spark.streaming.dstream.DStream anonfun$getOrCompute$1.apply(DStream.scala:334) at scala.Option.orElse(Option.scala:289)
为什么会报错???
这玩意只读文件夹,不读文件,谁知道!!!
把文件加一个文件夹装起来就行