请问我hive表需修改某字段(在表中的位置非末尾)类型由varchar(16)改为varchar(32),使用如下语句:ALTER TABLE table_name CHANGE [COLUMN] col_old_name col_new_name column_type [COMMENT col_comment]成功在hive侧修改了且查出来的表结构证实确实成功了。但spark查到的表结构却未更新且insert时报错:Caused by: java.lang.RuntimeException: Exceeds char/varchar type length limitation: 16
at org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils.trimTrailingSpaces(CharVarcharCodegenUtils.java:30) at org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils.varcharTypeWriteSideCheck(CharVarcharCodegenUtils.java:52) at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.writeFields_0_106$(Unknown Source) at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown Source) at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown Source)
【Hive问题 2】Hive修改字段类型异常背景 常见hive修改字段类型操作 但是有时候修改字段类型会出现以下异常: 其中可能是string类型无法转换为int等强转类型的限制 可以进行以下步骤的尝试解决上面遇到的问...