filmov
tv
0002 pyspark explode and explode outer with list data example using pyspark DataFrame methods

Показать описание
How to use explode and explode_outer with nested data (array or list) using Spark DataFrame
explode function removes rows where explode column has null or empty values
it won't consider other column values in the same row, even other columns has data with respect to same row
to keep null or empty row(s) of explode column, we need to go for explode_outer
explode_outer will works as it is explode but,
it keeps null or empty column row(s)
we have used following functions / methods from pyspark
1. explode (sql function)
2. explode_outer (sql function)
3. count (DataFrame's method)
4. printSchema (DataFrame's method)
5. select (DataFrame's method)
6. withColumn (DataFrame's method)
explode function removes rows where explode column has null or empty values
it won't consider other column values in the same row, even other columns has data with respect to same row
to keep null or empty row(s) of explode column, we need to go for explode_outer
explode_outer will works as it is explode but,
it keeps null or empty column row(s)
we have used following functions / methods from pyspark
1. explode (sql function)
2. explode_outer (sql function)
3. count (DataFrame's method)
4. printSchema (DataFrame's method)
5. select (DataFrame's method)
6. withColumn (DataFrame's method)