Back to Browse

Explode and Explode_Outer in PySpark| Databricks |

2.4K views
Oct 17, 2023
15:18

Hey Geeks, from pyspark.sql.types import ( StructType, StructField, StringType, IntegerType, ArrayType, ) from pyspark.sql.functions import explode, explode_outer data = [ (1, "Sagar", [20, 30, 40]), (2, "Alex", [40, 20, 10]), (3, "John", []), (4, "Kim", [20, 1, None]), ] # data=[(1,'Sagar',[20,30,40]),(2,'Alex',[40,20,10])] schema = StructType( [ StructField("ID", IntegerType(), True), StructField("Name", StringType(), False), StructField("Marks", ArrayType(IntegerType()), True), ] ) df = spark.createDataFrame(data, schema=schema) display(df) Databricks and PySpark: https://www.geekcoders.co.in/courses/Databricks-PySpark-RealTime-Scenarios-Interview-Question-Series-64b51b97e4b0cd66d91a1273-64b51b97e4b0cd66d91a1273 Build Real-Time DeltaLake Project using PySpark and Spark-SQL with Databricks: https://www.geekcoders.co.in/courses/Build-Real-Time-DeltaLake-Project--using-PySpark-and-Spark-SQL-with-Databricks-64a0af30e4b0f71237fa1bf3-64a0af30e4b0f71237fa1bf3 Full Playlist of Interview Questions of SQL: ✅https://www.youtube.com/watch?v=XZHp-u5QzYE&list=PLxy0DxWEupiOU8M_GkSTYOMLB7Q9pAAZe Full Playlist of Snowflake SQL: ✅https://www.youtube.com/watch?v=no5VjmmPDGc&list=PLxy0DxWEupiP3oJralHpT8SjtdBY0BpYR Full Playlist of Golang: ✅ https://www.youtube.com/watch?v=F3Wg2dYPh_U&list=PLxy0DxWEupiMckHLAJGQuHpYkKqYhqCZ5 Full Playlist of NumPY Library: ✅ https://www.youtube.com/watch?v=F3Wg2dYPh_U&list=PLxy0DxWEupiMckHLAJGQuHpYkKqYhqCZ5 Full Playlist of PTQT5: ✅ https://www.youtube.com/watch?v=NcATA... Full Playlist of Pandas: ✅ https://www.youtube.com/watch?v=DKTcf6Wyuck&list=PLxy0DxWEupiP86ruA3QWoBG1Rb0b1BH4n YouTube Link: https://www.youtube.com/channel/UCj4qaXEHCD82DiLhKdZjX6g Instagram: https://www.instagram.com/prajaji/ pyspark tutorial azure data factory pyspark data engineer roadmap azure databricks databricks tutorial pyspark tutorial for beginners #azuredataengineer #explode #databricksforbeginner #databricks

Download

1 formats

Video Formats

360pmp424.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Explode and Explode_Outer in PySpark| Databricks | | NatokHD