参考链接:https://stackoverflow.com/questions/37301241/spark-task-not-serializable-with-lag-window-function
https://www.cnblogs.com/aixing/p/13327364.html
java.io.NotSerializableException: org.apache.spark.sql.expressions.WindowSpec
因为窗口函数要想继承序列化接口还得自己定义一个类,所以选用的是最简单的方式:加@transient 修饰