title: How to convert the datasets of Spark Row into string?
body: <p>I have written the code to access the Hive table using SparkSQL. Here is the code: </p>
  
  <pre><code>SparkSession spark = SparkSession
          .builder()
          .appName("Java Spark Hive Example")
          .master("local[*]")
          .config("hive.metastore.uris", "thrift://localhost:9083")
          .enableHiveSupport()
          .getOrCreate();
  Dataset&lt;Row&gt; df =  spark.sql("select survey_response_value from health").toDF();
  df.show();
  </code></pre>
  
  <p>I would like to know how I can convert the complete output to String or String array? As I am trying to work with another module where only I can pass String or String type Array values.<br>
  I have tried other methods like <code>.toString</code> or typecast to String values. But did not worked for me.<br>
  Kindly let me know how I can convert the DataSet values to String?</p>