简体   繁体   English

编码“UTF8”的无效字节序列:从 S3 导入后处理时为 0x00

[英]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.

相关问题 AWS S3 Postgres 扩展`错误:编码“UTF8”的字节序列无效:0x8b` - AWS S3 Postgres Extension `ERROR: invalid byte sequence for encoding "UTF8": 0x8b` 字符串包含无效或不受支持的 UTF8 代码点。 错误的 UTF8 十六进制序列: - String contains invalid or unsupported UTF8 codepoints. Bad UTF8 hex sequence: 查询失败:编码“UTF8”的排序规则“numerickn”不存在 - Query failed: collation "numerickn" for encoding "UTF8" does not exist 在 sagemaker 中从 s3 导入模块 - import module from s3 in sagemaker AWS Wrangler Athena 和 S3 read_csv UnicodeDecodeError:“utf-8”编解码器无法解码位置中的字节 0xff - AWS Wrangler Athena and S3 read_csv UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 从 S3 存储桶下载 csv.gzip,它是象形文字(编码错误) - Downloaded csv.gzip from S3 bucket and it's in hieroglyphs (encoding error) XML 读卡器错误:com.ctc.wstx.exc.WstxIOException:无效 UTF-8 起始字节 0x8b(在 char #2,字节 #-1)WSO2 ESB - XML reader error: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x8b (at char #2, byte #-1) WSO2 ESB KeyError:尝试将数据从 S3 加载到 Sagemaker 时出现“ETag” - KeyError: 'ETag' while trying to load data from S3 to Sagemaker 尝试使用多处理从 s3 读取图像时遇到问题 - Facing issues while trying to read images from s3 with multiprocessing '0000-00-00 00:00:00' 作为无效时间戳 - '0000-00-00 00:00:00' as an invalid timestamp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM