sryza / aas

Code to accompany Advanced Analytics with Spark from O'Reilly Media
Other
1.52k stars 1.03k forks source link

NullPointerException in chapter9 #132

Closed appleyuchi closed 5 years ago

appleyuchi commented 5 years ago

Hi,everyone, Here's the code I use:

https://paste.ubuntu.com/p/c66fmtjNm3/

and I get the following error

Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties

Exception in thread "main" 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.IndexedSeqLike$class.iterator(IndexedSeqLike.scala:90) at scala.collection.mutable.ArrayOps$ofRef.iterator(ArrayOps.scala:186) at RunRisk.readStocksAndFactors(RunRisk.scala:130) at RunRisk$.main(RunRisk.scala:33) at RunRisk.main(RunRisk.scala)

Process finished with exit code 1`

could any one help? Thanks in advance

appleyuchi commented 5 years ago

sorry,I solve it just now , change hdfs path to local path.