title: Get WrappedArray row valule and convert it into string in Scala
body: <p>I have a data frame which comes as like below </p>
  
  <pre class="lang-none prettyprint-override"><code>+---------------------------------------------------------------------+
  |value                                                                |
  +---------------------------------------------------------------------+
  |[WrappedArray(LineItem_organizationId, LineItem_lineItemId)]         |
  |[WrappedArray(OrganizationId, LineItemId, SegmentSequence_segmentId)]|
  +---------------------------------------------------------------------+
  </code></pre>
  
  <p>From the above two rows I want to create a string which is in this format </p>
  
  <pre class="lang-none prettyprint-override"><code>"LineItem_organizationId", "LineItem_lineItemId"
  "OrganizationId", "LineItemId", "SegmentSequence_segmentId"
  </code></pre>
  
  <p>I want to create this as dynamic so in first column third value is present my string will have one more , separated columns value .</p>
  
  <p>How can I do this in Scala .</p>
  
  <p>this is what I am doing in order to create data frame </p>
  
  <pre><code> val xmlFiles = "C://Users//u6034690//Desktop//SPARK//trfsmallfffile//XML"
      val discriptorFileLOcation = "C://Users//u6034690//Desktop//SPARK//trfsmallfffile//FinancialLineItem//REFXML"
      import sqlContext.implicits._
  
      val dfDiscriptor = sqlContext.read.format("com.databricks.spark.xml").option("rowTag", "FlatFileDescriptor").load(discriptorFileLOcation)
      dfDiscriptor.printSchema()
      val firstColumn = dfDiscriptor.select($"FFFileType.FFRecord.FFField").as("FFField")
      val FirstColumnOfHeaderFile = firstColumn.select(explode($"FFField")).as("ColumnsDetails").select(explode($"col")).first.get(0).toString().split(",")(5)
      println(FirstColumnOfHeaderFile)
      //dfDiscriptor.printSchema()
      val primaryKeyColumnsFinancialLineItem = dfDiscriptor.select(explode($"FFFileType.FFRecord.FFPrimKey.FFPrimKeyCol"))
      primaryKeyColumnsFinancialLineItem.show(false)
  </code></pre>
  
  <p>Adding the full schema</p>
  
  <pre class="lang-none prettyprint-override"><code>   root
   |-- FFColumnDelimiter: string (nullable = true)
   |-- FFContentItem: struct (nullable = true)
   |    |-- _VALUE: string (nullable = true)
   |    |-- _ffMajVers: long (nullable = true)
   |    |-- _ffMinVers: double (nullable = true)
   |-- FFFileEncoding: string (nullable = true)
   |-- FFFileType: array (nullable = true)
   |    |-- element: struct (containsNull = true)
   |    |    |-- FFPhysicalFile: array (nullable = true)
   |    |    |    |-- element: struct (containsNull = true)
   |    |    |    |    |-- FFFileName: string (nullable = true)
   |    |    |    |    |-- FFRowCount: long (nullable = true)
   |    |    |-- FFRecord: struct (nullable = true)
   |    |    |    |-- FFField: array (nullable = true)
   |    |    |    |    |-- element: struct (containsNull = true)
   |    |    |    |    |    |-- FFColumnNumber: long (nullable = true)
   |    |    |    |    |    |-- FFDataType: string (nullable = true)
   |    |    |    |    |    |-- FFFacets: struct (nullable = true)
   |    |    |    |    |    |    |-- FFMaxLength: long (nullable = true)
   |    |    |    |    |    |    |-- FFTotalDigits: long (nullable = true)
   |    |    |    |    |    |-- FFFieldIsOptional: boolean (nullable = true)
   |    |    |    |    |    |-- FFFieldName: string (nullable = true)
   |    |    |    |    |    |-- FFForKey: struct (nullable = true)
   |    |    |    |    |    |    |-- FFForKeyCol: string (nullable = true)
   |    |    |    |    |    |    |-- FFForKeyRecord: string (nullable = true)
   |    |    |    |-- FFPrimKey: struct (nullable = true)
   |    |    |    |    |-- FFPrimKeyCol: array (nullable = true)
   |    |    |    |    |    |-- element: string (containsNull = true)
   |    |    |    |-- FFRecordType: string (nullable = true)
   |-- FFHeaderRow: boolean (nullable = true)
   |-- FFId: string (nullable = true)
   |-- FFRowDelimiter: string (nullable = true)
   |-- FFTimeStamp: string (nullable = true)
   |-- _env: string (nullable = true)
   |-- _ffMajVers: long (nullable = true)
   |-- _ffMinVers: double (nullable = true)
   |-- _ffPubstyle: string (nullable = true)
   |-- _schemaLocation: string (nullable = true)
   |-- _sr: string (nullable = true)
   |-- _xmlns: string (nullable = true)
   |-- _xsi: string (nullable = true)
  </code></pre>