Re: Cannot convert from JavaRDD to Dataframe

2017-04-24 Thread Radhwane Chebaane
Hi, DataTypes is a Scala Array which corresponds in Java to Java Array. So you must use a String[]. However since RowFactory.create expects an array of Object as Columns content, it should be: public Row call(String line){ return RowFactory.create(new String[][]{line.split(" ")}); }

Cannot convert from JavaRDD to Dataframe

2017-04-23 Thread Chen, Mingrui
Hello everyone! I am a new Spark learner and trying to do a task seems very simple. I want to read a text file, save the content to JavaRDD and convert it to Dataframe, so I can use it for Word2Vec Model in the future. The code looks pretty simple but I cannot make it work: SparkSession spar