spark程序报错 unicode object has no attitube tzinfo

来源:互联网 发布:知乎有名的富二代 编辑:程序博客网 时间:2024/05/16 10:05

spark 程序运行 报错 unicode object has no attitube tzinfo

错误发生的背景是这样的,构建parquet格式的测试用例,请求时间用的用的 StringType.  

处理过后 以parquet写HDFS的话  是TimestampType格式  所以会报这样的错



解决:

req_time = datetime.datetime.strptime(row.req_time, "%Y-%m-%d %H:%M:%S")

把string类型转换为 时间类型







阅读全文
0 0
原创粉丝点击