How to use lead() in SparkR

30 views
Skip to first unread message

guangw...@gmo.jp

unread,
Sep 22, 2016, 11:24:26 PM9/22/16
to SparkR Developers
I need the function lead(), but i could not find the right way to call it.

I tried like this, but get an error.

df <- withColumn(df, "next", lead(df$colA, 1))

the error is:
org.apache.spark.sql.AnalysisException: unresolved operatore 'Project ....

I determined the return of lead(df$colA, 1) is a Column of Dataframe.

Any help is appreciated.

Shivaram Venkataraman

unread,
Sep 23, 2016, 5:51:24 PM9/23/16
to guangw...@gmo.jp, SparkR Developers
This mailing list is no longer active as the SparkR project is now a
part of Apache Spark. Please email the Spark user / dev mailing list
as specified at http://spark.apache.org/community.html

Thanks
Shivaram
> --
> You received this message because you are subscribed to the Google Groups
> "SparkR Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sparkr-dev+...@googlegroups.com.
> To post to this group, send email to spark...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sparkr-dev/98f3e611-e31a-470d-8229-d06cb41d92a9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages