【问题标题】:Error: while Importing data into Redshift错误:将数据导入 Redshift 时
【发布时间】:2017-08-27 14:48:56
【问题描述】:

我想从一个数据库(生产)卸载并重新加载到 Redshift 中具有完全相同架构的另一个数据库(QA)。

我发出如下 S3 加载命令。

copy table(col1,col2,col3,col4) from 's3://<bucket_path>/<file_name>.gzip' CREDENTIALS 'aws_access_key_id=<your_key>;aws_secret_access_key=<your_secret>'  delimiter '|' gzip NULL AS 'null_string';

出现以下错误。

ERROR: Failed writing body (0 != XXX) 原因: 无法充气无效或不完整的放气数据。 zlib 错误代码:-3

  error:  Failed writing body (0 != XXX) Cause: Failed to inflateinvalid or incomplete deflate data. zlib error code: -3
  code:      9001
  context:   S3 key being read : s3://<some_s3_bucket>/<some_s3_bucket_file>
  query:     XXXXX
  location:  table_s3_scanner.cpp:355
  process:   query1_23 [pid=2008]
  -----------------------------------------------

【问题讨论】:

  • 看起来像解压 gzip 文件时出错。 gzip 文件是如何创建的?能不能下载并解压成功?
  • 谢谢约翰!是的,你是对的。我的 gzip 文件本身有问题,而且文件不正确。我用 gzip 创建了不同的文件并且工作正常。

标签: sql amazon-redshift sqlbulkcopy


【解决方案1】:

当您在复制过程中尝试使用 Gzip 文件并且它无法将文件作为 Gzip 读取时,会发生这种情况。

如果我做出了错误的假设,请发表评论,我会重新调整答案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 2011-06-19
    • 1970-01-01
    相关资源
    最近更新 更多