Stack Exchange
Spark DataFrame not allowing multiple dynamic column list with window function in group by
sample code:- 
val list=Seq("symbol").map(column=>col(column))
    val windowedCount = stockDs
      .withWatermark("time", "500 milliseconds")
      .groupBy( list:_*,
        window($"time", "10 seconds")
      )
      .sum("value")


`Error : _*' annotation allowed here
  (such annotations are only allowed in arguments to *-parameters) .


also, I have tried below code but not succeed yet:   .groupBy(Seq(col("b")) ++ Seq(col("b"), col("b")):_*,
window($"time", "10 seconds")

groupBy signature is

 def groupBy(cols: Column*): RelationalGroupedDataset 


So you can provide only a single sequence argument:
stockDs
  ...
  .groupBy(list :+ window($"time", "10 seconds"): _*)

