为什么ACCEPTINVCHARS在这里不起作用? [英] Why doesn't ACCEPTINVCHARS work here?

查看:123
本文介绍了为什么ACCEPTINVCHARS在这里不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将数据加载到Redshift时出现加载错误.我的错误是:

I'm getting load errors when trying to load data into Redshift. My error is:

Missing newline: Unexpected character 0x24 found at location nnn 

我正在使用包含ACCEPTINVCHARS选项的此命令,并且所涉及的列定义为VARCHAR(80)

I'm using this command which includes the ACCEPTINVCHARS option, and the column in question is defined as VARCHAR(80)

copy <dest_tbl> from <S3 source> 
CREDENTIALS <my_credentials>  IGNOREHEADER 1 ENCODING UTF8 
IGNOREBLANKLINES NULL AS '\\N' 
EMPTYASNULL BLANKSASNULL gzip ACCEPTINVCHARS timeformat 'auto' 
dateformat 'auto' MAXERROR 1 compupdate on;

错误在vi中看起来像这样

The errors look like this in vi

八进制转储如下所示:

An octal dump looks like this:

鉴于ACCEPTINVCHARS

I'm not understanding why this is failing given the ACCEPTINVCHARS documentation at Amazon Can anyone suggest a solution or a workaround? Put another way, what do I need to do to ensure that Redshift accepts this string in this field?

推荐答案

八进制转储显示它们是空值(NUL),被redshift copy命令视为行终止符.

Octal dump shows they are null values (NUL) which are treated as line terminator by redshift copy command.

使用NULL AS'\ 0'代替默认的'\ N'

Use NULL AS '\0' instead default '\N',

这篇关于为什么ACCEPTINVCHARS在这里不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆