Details
Description
Assume this dataframe:
val df = Seq(1, 2, 3).toDF("v")
This works:
df.select(Seq(explode(array(min($"v"), max($"v"))), sum($"v")): _*).collect
However, this doesn't:
df.select(Stream(explode(array(min($"v"), max($"v"))), sum($"v")): _*).collect
It throws this error:
java.lang.NullPointerException at org.apache.spark.sql.catalyst.analysis.Analyzer$GlobalAggregates$.$anonfun$containsAggregates$1(Analyzer.scala:2516) at scala.collection.immutable.List.flatMap(List.scala:366) at org.apache.spark.sql.catalyst.analysis.Analyzer$GlobalAggregates$.containsAggregates(Analyzer.scala:2515) at org.apache.spark.sql.catalyst.analysis.Analyzer$GlobalAggregates$$anonfun$apply$31.applyOrElse(Analyzer.scala:2509) at org.apache.spark.sql.catalyst.analysis.Analyzer$GlobalAggregates$$anonfun$apply$31.applyOrElse(Analyzer.scala:2508)
The only difference between the two queries is that the first one uses Seq to specify the varargs, whereas the second one uses Stream.