我正在尝试将Python数据框写入redshift。我写了这段代码 -
df.to_sql('df', redshiftEngine, index = False, if_exists = 'replace')
redshiftENgine = create_engine('skipping the details')
我收到以下错误:
DataError: value too long for type character varying(256)
进一步深入研究sqalchemy文档,我发现了这个:
Exception raised for errors that are due to problems with the processed data like division by zero, numeric value out of range, etc.This error is a DBAPI Error and originates from the database driver (DBAPI), not SQLAlchemy itself.
但我仍然不确定如何处理这个错误。我有300多列和3000多行。
以前有人遇到过这个吗?