Just .groupBy(...).count() ? On Tue, Apr 19, 2022 at 6:24 AM marc nicole <mk1853...@gmail.com> wrote:
> Hello guys, > > I want to group by certain column attributes (e.g.,List<Column > > groupByQidAttributes) a dataset (initDataset) and then count the > occurrences of associated grouped rows, how do i achieve that neatly? > I tried through the following code: > Dataset<Row> groupedRowsDF = initDataset.withColumn("qidsFreqs", count("*" > ).over(Window.partitionBy(groupByQidAttributes.toArray(new Column[ > groupByQidAttributes.size()])))); Is that OK to use for the purpose? > >