Assuming MessageHelper.sqlMapping schema is correctly mapped with input json
(it would help if the schema and sample json is shared)here is explode
function with dataframes similar functionality is available with SQL import
sparkSession.implicits._import org.apache.spark.sql.functions._val
routeEventDF=dataDF.select($"messageId"
,explode($"messageData").alias("MessageData"))                                  
 
.select($"messageId", $"MessageData.unixTime",$"MessageData.packetID",          
                                     
$"MessageData.messageID") routeEventDF.show thanksVijay



--
Sent from: http://apache-spark-user-list.1001560.n3.nabble.com/

Reply via email to