I have a table as shown:
I want to transform it into the following table using Spark Java or Spark Scala
make sure you have unique column names, denn you can do :
import or.apache.spark.sql.functions._ table .select("id","movie",explode(array("cast1", "cast2", "cast3", "cast4")).as("cast")) .where(col("cast").isNotNull)
1.4m articles
1.4m replys
5 comments
57.0k users