[英]invalid byte sequence for encoding "UTF8": 0x00 while postgress import from S3
I am importing data from S3 csv file to Pstgress RDS using aws_s3 Extention and it gives an error in between import我正在使用 aws_s3 扩展将数据从 S3 csv 文件导入到 Pstgress RDS,它在导入之间给出了一个错误
Command命令
psql=> SELECT aws_s3.table_import_from_s3( 't1',
psql=> SELECT aws_s3.table_import_from_s3( 't1',
'(format csv)', :'s3_uri' );
'(格式 csv)', :'s3_uri' );
Error错误
ERROR: invalid byte sequence for encoding "UTF8": 0x00 CONTEXT: COPY t1, line 7324484错误:编码“UTF8”的无效字节序列:0x00 上下文:COPY t1,第 7324484 行
I tried to change the column type to text but not working我试图将列类型更改为文本但不起作用
If you really have ASCII 0x00 in your input data you need to specify this as the NULL character with NULL AS '\000' in your COPY command.如果您的输入数据中确实有 ASCII 0x00,您需要在 COPY 命令中将其指定为 NULL 字符和 NULL AS '\000'。
See - https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-conversion.html请参阅 - https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-data-conversion.html
My data was contain invalid values, and that needs to be cleaned我的数据包含无效值,需要清理
while I was trying to export data from Redshift and import it to S3, I found redshift has some support to clean this type of data当我尝试从 Redshift 导出数据并将其导入 S3 时,我发现 redshift 有一些支持来清理此类数据
here is link to the solution https://aws.amazon.com/premiumsupport/knowledge-center/remove-invalid-characters-redshift-data/这是解决方案的链接https://aws.amazon.com/premiumsupport/knowledge-center/remove-invalid-characters-redshift-data/
thanks谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.