问题描述
我对此线程(How to write stream to S3 with year,month and day of the day when records were received?)中发布的要求非常相似。
但是没有用。谁能告诉我我在这里想念的东西吗?
val formatDf = df.selectExpr("CAST(value AS STRING)")
.select(from_json($"value",schema).as("sInput")) // select the value and give one alias name
.select("sInput.*") // flatten the struct field
.withColumn("triggeringModels",explode($"triggeringModels")) // <-- explode the array field.
.map(row => {
returnObject //这是表达式的返回值 }
.withColumn("year",functions.date_format(df.col("date"),"YYYY"))
.writeStream
.format("parquet")
.option("path","path")
.option("checkpointLocation","checkpointpath")
.partitionBy("date")
.start()```
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)