尝试从Firehose摄取数据时会出现错误

发布于 2025-02-07 21:25:53 字数 619 浏览 3 评论 0原文

命令中造成错误1206和1205,

下面的原始数据

{
    "Name": "yoyo"
    "a_timestamp": "2021-05-11T15:02:02.426729Z",
    "a_date": "2021-05-11T00:00:00Z"
}

在下面的copy命令下,在下面的复制命令中,在下面的copy命令中,在下面的copy

COPY pqr_table FROM 's3://xyz/<manifest>' CREDENTIALS 'aws_iam_role=arn:aws:iam::<aws-account-id>:role/<role-name>' MANIFEST json 's3://xyz/abc.json' DATEFORMAT 'YYYY-MM-DD' ;

是下面的复制命令

create table events (
Name varchar(8), 
a_timestamp timestamp,
a_date date)


It would be great if anyone can please help me with this

getting an error 1206 and 1205 when injesting data from fireshose to redshift using a copy command

Below is the raw data on firehose

{
    "Name": "yoyo"
    "a_timestamp": "2021-05-11T15:02:02.426729Z",
    "a_date": "2021-05-11T00:00:00Z"
}

below is the copy command

COPY pqr_table FROM 's3://xyz/<manifest>' CREDENTIALS 'aws_iam_role=arn:aws:iam::<aws-account-id>:role/<role-name>' MANIFEST json 's3://xyz/abc.json' DATEFORMAT 'YYYY-MM-DD' ;

below is the DDL command

create table events (
Name varchar(8), 
a_timestamp timestamp,
a_date date)


It would be great if anyone can please help me with this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

许你一世情深 2025-02-14 21:25:53

这些是不良时间戳和日期格式的错误。您需要使用该字符串指定“ TimeFormat”,因为它不是RedShift的默认格式。我首先尝试这两种“自动”,看看RedShift是否可以解决问题。

dateformat as 'auto'
timeformat as 'auto'

同样,在您的日期中指定时间可能会造成一些混乱,并且可能需要您手动指定格式或摄入为时间戳,然后再施放到迄今为止。我会拳头看看“自动”是否可以解决问题。

Those are errors for bad timestamp and date formats. You need to have "timeformat" specified with that string as it is not Redshift's default format. I'd first try 'auto' for both of these and see if Redshift can work things out.

dateformat as 'auto'
timeformat as 'auto'

Also, having time specified in your date may create some confusion and may need you to manually specify the format or ingest as timestamp and then cast to date. I'd fist see if 'auto' does the trick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文