spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Khalid Mammadov <khalidmammad...@gmail.com>
Subject Re: Missing stack function from SQL functions API
Date Tue, 15 Jun 2021 11:10:45 GMT
Hi David

If you need alternative way to do it you can use below:
df.select(expr("stack(2, 1,2,3)"))
Or
df.withColumn('stacked', expr("stack(2, 1,2,3)"))

Thanks
Khalid

On Mon, 14 Jun 2021, 10:14 , <david.szakallas@gmail.com> wrote:

> I noticed that the stack SQL function
> <https://spark.apache.org/docs/latest/api/sql/#stack> is missing from the functions
> API
> <https://spark.apache.org/docs/3.1.2/api/java/org/apache/spark/sql/functions.html>.
> Could we add it?
>

Mime
View raw message