像这样:
df.registerTempTable("df")sqlContext.sql(""" SELECt *, CAST(date AS bigint) - CAST(lag(date, 1) OVER ( PARTITION BY user_id ORDER BY date) AS bigint) FROM df""")
欢迎分享,转载请注明来源:内存溢出
像这样:
df.registerTempTable("df")sqlContext.sql(""" SELECt *, CAST(date AS bigint) - CAST(lag(date, 1) OVER ( PARTITION BY user_id ORDER BY date) AS bigint) FROM df""")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)