0

I have two seq objects. I am mergeing those two objects using

a.zip(b)

It gives me schema

 |    |-- element: struct (containsNull = true)
 |    |    |-- _1: string (nullable = true)
 |    |    |-- _2: double (nullable = false)

I want that schema to be

 |    |-- element: struct (containsNull = true)
 |    |    |-- name: string (nullable = true)
 |    |    |-- value: double (nullable = false)

How can I convert this?

It is an inner row to existing row

Chirag
  • 56
  • 1
  • 8

1 Answers1

0

chech the code please

a.zip(b).toDF("name","value")
rogue-one
  • 11,259
  • 7
  • 53
  • 75
Robin
  • 695
  • 1
  • 7
  • 10
  • It gives me exception java.lang.UnsupportedOperationException: Schema for type org.apache.spark.sql.Dataset[org.apache.spark.sql.Row] is not supported at org.apache.spark.sql.catalyst.ScalaReflection$.schemaFor(ScalaReflection.scala:733) at org.apache.spark.sql.catalyst.ScalaReflection$.schemaFor(ScalaReflection.scala:671) at org.apache.spark.sql.functions$.udf(functions.scala:3088) – Chirag Jul 24 '17 at 02:16