Quantcast
Channel: Load CSV data in to Dataframe and convert to Array using Apache Spark (Java) - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Matko Soric for Load CSV data in to Dataframe and convert to Array...

you can use VectorAssembler class to create as array of features, which is particulary useful with pipelines:val assembler = new VectorAssembler() .setInputCols(Array("city", "status", "vendor"))...

View Article



Answer by abaghel for Load CSV data in to Dataframe and convert to Array...

Below is the sample code in Java. You need to read your file using spark.read().text(String path) method and then call the split function.import static org.apache.spark.sql.functions.split;public class...

View Article

Load CSV data in to Dataframe and convert to Array using Apache Spark (Java)

I have a CSV file with below data : 1,2,5 2,4 2,3 I want to load them into a Dataframe having schema of string of arrayThe output should be like below.[1, 2, 5] [2, 4] [2, 3] This has been answered...

View Article
Browsing all 3 articles
Browse latest View live


Latest Images