如何在不转换为null的情况下将空字符串插入Amazon Redshift中?
我正在尝试使用Pipe定界符CSV文件在RedShift中使用复制命令加载数据,而加载||
empty正在按照我的意愿转换为null,但是|“” |
也转换为零。我该如何处理这种情况?
I am trying to load data using copy command in Redshift using pipe delimiter csv file, while loading ||
empty is getting converted to NULL as I wanted but |""|
this also getting converted to NULL. How can I handel this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能已启用了emptyasnull选项,或者将null作为“副本”。这些中的任何一个都会在复制过程中将空字符串转换为null。
请参阅: https://docs.aws.aws.aws.aws.amazon.com/redshift/最新/dg/r_copy.html
如果未选择这些选项,请发布示例命令和数据。
Likely you have the EMPTYASNULL option enabled or have NULL AS '' for your COPY. Either of these will convert empty strings to NULL during COPY.
See: https://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html
If neither of these options are selected then please post example commands and data.
\ copy(从schema.table中选择 * * path/filename.csv'null'null'null'dilemeter'|' CSV标头;
用于导出。在Redshift中,我在其工作的“复制命令”中使用
null作为'null'
选项。\copy (select * from schema.table) to 'path/filename.csv' NULL 'NULL' DELIMETER '|' CSV HEADER;
for exporting.In Redshift I used
NULL as 'NULL'
option in the copy command it worked.