This is funny! My intention was sort exactly the opposite - if none of these functions (including updateStateByKey) satisfy your computation requirements, here is the final operation that allows you to implement your arbitrary operation. I am finding it a little weird to have the following flow
1) map, filter, etc *simple ops*
2) transform *advanced op* for anything
3) updateStateByKey "simple op"