cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Window function + Multiple simultaneous aggregations

KarthikeyanB
New Contributor II

Hi team,

Why is there no support to perform multiple aggregations together with a single window spec? ie I dont want to specify each aggregation separately and I don't want to see each aggregation perform as a separate piece of work.

Or if there is indeed a way (other than say UDF), please do enlighten me.

Please advise.

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @Karthikeyan Balachandran​ , In Apache Spark™, the window functions allow you to perform multiple aggregations using a single window specification. By defining various aggregations within the exact window specification, you can avoid separate computations for each aggregation.

View solution in original post

3 REPLIES 3

Kaniz
Community Manager
Community Manager

Hi @Karthikeyan Balachandran​ , In Apache Spark™, the window functions allow you to perform multiple aggregations using a single window specification. By defining various aggregations within the exact window specification, you can avoid separate computations for each aggregation.

KarthikeyanB
New Contributor II

Hi @Kaniz Fatma​ ,

Firstly, thank you much for responding.

Thank you for confirming that performing multiple aggr using a single window spec does NOT evaluate the window spec separately each time. My bad in the wrong understanding prior.

@Karthikeyan Balachandran​​ , Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question. Share the wisdom! By marking the best answers, you allow others in our community to find valuable data quickly and efficiently.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.