使用spark计算elasticsearch中的数据是时间时,报如下错误:

说明:涉及到时间的数据,在读写数据时出现时区问题,导致该问题的原因时spark在读数据时会解析时间,但是1989年的时区夏令和冬令有冲突,导致无法正常解析
解决方法:在使用spark读取elasticsearch中的数据时,将时间字段安装字符串读取,而不是以时间的方式进行读取,所以在读取数据时将'es.mapping.date.rich'关闭
spark.read.format('es')
.option('es.nodes',esmeta.esNodes)
.option('es.resource',esmeta.esIndex)
.option('es.read.field.include',esmeta.selectFields)
.option('es.mapping.date.rich','false')
.load()