Вы можете просто выбрать a._href и назначить его новому столбцу.Попробуйте это решение Scala.
scala> case class sub(_value:String,_href:String)
defined class sub
scala> val df = Seq((17,Array(sub("Gwendolyn Tucke","http://facebook.com"),sub("i have"," http://youtube.com"))),(23,Array(sub("letter","http://google.com"),sub("hihow are you","http://google.co.il")))).toDF("id","a")
df: org.apache.spark.sql.DataFrame = [id: int, a: array<struct<_value:string,_href:string>>]
scala> df.show(false)
+---+-----------------------------------------------------------------------+
|id |a |
+---+-----------------------------------------------------------------------+
|17 |[[Gwendolyn Tucke, http://facebook.com], [i have, http://youtube.com]]|
|23 |[[letter, http://google.com], [hihow are you, http://google.co.il]] |
+---+-----------------------------------------------------------------------+
scala> df.select("id","a._href").show(false)
+---+------------------------------------------+
|id |_href |
+---+------------------------------------------+
|17 |[http://facebook.com, http://youtube.com]|
|23 |[http://google.com, http://google.co.il] |
+---+------------------------------------------+
Вы можете назначить его новому столбцу
scala> val df2 = df.withColumn("result",$"a._href")
df2: org.apache.spark.sql.DataFrame = [id: int, a: array<struct<_value:string,_href:string>> ... 1 more field]
scala> df2.show(false)
+---+-----------------------------------------------------------------------+------------------------------------------+
|id |a |result |
+---+-----------------------------------------------------------------------+------------------------------------------+
|17 |[[Gwendolyn Tucke, http://facebook.com], [i have, http://youtube.com]]|[http://facebook.com, http://youtube.com]|
|23 |[[letter, http://google.com], [hihow are you, http://google.co.il]] |[http://google.com, http://google.co.il] |
+---+-----------------------------------------------------------------------+------------------------------------------+
scala> df2.printSchema
root
|-- id: integer (nullable = false)
|-- a: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- _value: string (nullable = true)
| | |-- _href: string (nullable = true)
|-- result: array (nullable = true)
| |-- element: string (containsNull = true)
scala>