使用hive sql 创建表的事情,出现以下的问题:Caused by: org.apache.spark.SparkException: Cannot recognize hive type string: null。
出现问题的原因:
在sql中,存在null字段。
解决办法:
将null字段进行转换,或者改写成其他。
create table testtable as select null as item from ...
修改成
create table testtable as select cast(null as string) as item from ...