Spark SQL Window () Powerful ways
Spark window function perform calculations & aggregations on certain data groups than entire dataset. Also, handles ranking, cumulative sum and averages.
Spark window function perform calculations & aggregations on certain data groups than entire dataset. Also, handles ranking, cumulative sum and averages.
UDF (User-Defined Function) is used for custom data transformations or calculations which are not available in the built-in Spark SQL functions
cache() and persist() allow you to persist intermediate or frequently used data in memory, in order to improve the performance of subsequent operations.
In PySpark collect() function is used to retrieve all the elements of Dataframe or Dataset and return them as a local collection or array in the driver program
the union() function is used to combine two dataframes with the same schema. It creates a new dataframe that includes all the rows from both dataframes
foreach() and foreachPartition() are used to apply function to each element of Dataframe or RDD. they differ in behavior and usage when used with distributed data
map() and mapPartitions() are used to apply a transformation on each element of a Dataframe or RDD. there are some differences in their behavior and usage.
distinct() function is used to retrieve unique rows from a Dataframe. It returns a new Dataframe with distinct rows based on all the columns of original df
withColumnRenamed() function is used to rename a column in df. It allows you to change the name of a column to new name while keeping the rest of the df…
withColumn() function is used to add a new column or replace an existing column in a df. It allows you to transform and manipulate data by applying expressions