I have created a dataframe using spark SQL in Java.
Dataset<Row> dateDF = spark.sql("select dates from dim_date where dates between '2017-01-01' and '2017-01-04'");
When I use the show() method it returns each date in new line. I understand that it is basically one column.
I want those values in a String variable with single quotes like this:
'2017-01-01','2017-01-02','2017-01-03,'2017-01-04'
How can I achieve this?