我正在尝试将数据帧保存到镶木地板,然后将它们加载到红移中。为此,我执行以下操作:
parquet_buffer = BytesIO()
df.to_parquet(parquet_buffer,index=False,compression='gzip')
s3.Bucket(write_bucket).put_object(Key=write_path,Body=parquet_buffer.getvalue())
然后我使用“COPY”命令将保存的文件直接加载到redshift中:
COPY table_name
from write_path
iam_role my_iam_role
FORMAT AS PARQUET
它导致以下错误:
write path: has an incompatible Parquet schema for column ...
如果我对 .csv 应用相同的程序,它工作得很好。切换到镶木地板时出现问题的原因是什么?