找不到Redshift COPY命令定界符 [英] Redshift COPY command delimiter not found
问题描述
我正在尝试将一些文本文件加载到Redshift.它们用制表符分隔,最后一行值之后除外.这导致找不到定界符错误.我只看到一种在COPY语句中设置字段定界符的方法,而没有一种设置行定界符的方法.有什么想法不涉及处理我的所有文件以在每行的末尾添加一个标签吗?
I'm trying to load some text files to Redshift. They are tab delimited, except for after the final row value. That's causing a delimiter not found error. I only see a way to set the field delimiter in the COPY statement, not a way to set a row delimiter. Any ideas that don't involve processing all my files to add a tab to the end of each row?
谢谢
推荐答案
我认为问题不在于行尾缺少<tab>
.您确定所有行的字段数都正确吗?
I don't think the problem is with missing <tab>
at the end of lines. Are you sure that ALL lines have correct number of fields?
运行查询:
select le.starttime, d.query, d.line_number, d.colname, d.value,
le.raw_line, le.err_reason
from stl_loaderror_detail d, stl_load_errors le
where d.query = le.query
order by le.starttime desc
limit 100
获取完整的错误报告.它将显示带有错误,行号错误和错误详细信息的文件名.
to get the full error report. It will show the filename with errors, incorrect line number, and error details.
这将有助于查找问题所在.
This will help to find where the problem lies.
这篇关于找不到Redshift COPY命令定界符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!