Skip to content Skip to sidebar Skip to footer
Showing posts with the label Apache Spark

Spark - Set Null When Column Not Exist In Dataframe

I'm loading many versions of JSON files to spark DataFrame. some of the files holds columns A,B… Read more Spark - Set Null When Column Not Exist In Dataframe

How To Merge Multiple Rows Into Single Cell Based On Id And Then Count?

How to merge multiple rows into single cell based on id using PySpark? I have a dataframe with ids … Read more How To Merge Multiple Rows Into Single Cell Based On Id And Then Count?

Removing Duplicate Columns After A Df Join In Spark

When you join two DFs with similar column names: df = df1.join(df2, df1['id'] == df2['i… Read more Removing Duplicate Columns After A Df Join In Spark

How To Optimize This Code On Spark?

How to make this code more efficient in Spark? I need to calculate minimum, maximum, count, mean fr… Read more How To Optimize This Code On Spark?

Spark: How To Parse Json String Of Nested Lists To Spark Data Frame?

How to parse JSON string of nested lists to spark data frame in pyspark ? Input data frame: +------… Read more Spark: How To Parse Json String Of Nested Lists To Spark Data Frame?

How To Convert Numpy Array Elements To Spark Rdd Column Values

I'm getting ready to use the built-in CSV printing facility of the spark dataframe (not pandas)… Read more How To Convert Numpy Array Elements To Spark Rdd Column Values