I'm trying to filter a dataset by order status. This is my code:
 df1=all_in_all_df.groupBy("productName") \
 .agg(F.max('orderItemSubTotal')) \
 .filter(col("orderStatus") == "CLOSED") \
 .show()
But when I run the code, I get the following error:
AnalysisException: cannot resolve 'orderStatus' given input columns: [max(orderItemSubTotal), productName]; 'Filter ('orderStatus = CLOSED)
Removing the .filter() helps displaying a result but I need to filter the data.