I use Spark 2.3.2.

I'm receiving data from Kafka. I must do **multiple aggregations on the same data**. Then all aggregations results will go to the **same database (columns or tables may be changed)**. For example:

```
val kafkaSource = spark.readStream.option("kafka") ...
val agg1 = kafkaSource.groupBy().agg ...
val agg2 = kafkaSource.groupBy().mapgroupswithstate() ...
val agg3 = kafkaSource.groupBy().mapgroupswithstate() ...

```

But when I try call writeStream for each aggregation result:

```
aggr1.writeStream().foreach().start()
aggr2.writeStream().foreach().start()
aggr3.writeStream().foreach().start()

```

Spark receives data independently in each writeStream. Is this way efficient? 

Can I do multiple aggregations with one writeStream? If it is possible, this way is efficient?