向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)));

原文地址:https://www.cnblogs.com/canwyq/p/9585236.html