Stream UDF are read only in nature. And also given the distributed nature of the aggregation, final reduce would happen on the client side only. So there is no way to write result of the stream back to the server in a single call.
Scope of the Record UDF is single record. That means you can read and write only 1 record, there is no way to write data on the some other set (i.e some other record). This is for reason that the NEW record being written could be actually reside on different physical node, that would mean a need to do network hop from inside lua function.
If you can elaborate on your use case. We can help you find a best alternative way to achieve it.