Hi,
How to convert a Dataset<Row> to a Dataset<String>?
What i have tried is:

List<String> list = dataset.as(Encoders.STRING()).collectAsList();
Dataset<String> datasetSt = spark.createDataset(list, Encoders.STRING());
// But this line raises a org.apache.spark.sql.AnalysisException: Try to
map struct... to Tuple1, but failed as the number of fields does not line
up

Type of columns being String
How to solve this?

Reply via email to