向Impala里Insert数据时报错:(type: STRING) would need to be cast to VARCHAR(100) for column

向Impala里Insert数据时报错:(type: STRING) would need to be cast to VARCHAR(100) for column

 

原SQL

 INSERT INTO CTS.attribute (id ,attCode)VALUES (2 , 'supplier');

执行时报错:

AnalysisException: Possible loss of precision for target table 'CTS.attribute'. Expression ''supplier'' (type: STRING) would need to be cast to VARCHAR(100) for column 'attcode'

 

修改为:

 INSERT INTO CTS.attribute (id ,attCode)VALUES (2 , CAST('supplier' AS varchar(100)));

 

posted @ 2018-09-04 16:29  王亚卿  阅读(1121)  评论(0编辑  收藏  举报