Split dataset based on column values in spark
I am trying to split the Dataset into different Datasets based on Manufacturer column contents. It is very slow Please suggest a way to improve the code, so that it can execute faster and reduce the usage of Java code. List<Row> lsts= countsByAge.collectAsList(); for(Row lst:lsts) { String man = lst.toString(); man = man.replaceAll("[\\p{Ps}\\p{Pe}]", ""); Dataset<Row> DF = src.filter("Manufacturer='" + man + "'"); DF.show(); } The Code, Input and Output Datasets are as shown below. package org.sparkexample; import org.apache.parquet.filter2.predicate.Operators.Column; import org.apache.spark.
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.