DataType interval is not supported - Spark SQL

放肆的年华 提交于 2019-12-24 18:59:28

问题


I am running a query on AWS EMR and the query errors out on this line -

to_date('1970-01-01', 'YYYY-MM-DD') + CAST(concat(mycolumn, ' seconds') AS INTERVAL)  AS date_col

The error - DataType interval is not supported.(line 521, pos 82)

Can someone help me with this?


回答1:


I think Spark supports the interval key word. It would be used as:

to_date('1970-01-01', 'YYYY-MM-DD') + mycolumn * interval '1 second' AS date_col


来源:https://stackoverflow.com/questions/59366658/datatype-interval-is-not-supported-spark-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!