如何在不转换为null的情况下将空字符串插入Amazon Redshift中?

发布于 2025-02-07 13:12:58 字数 128 浏览 1 评论 0原文

我正在尝试使用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 技术交流群。

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

发布评论

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

评论(2

伴我心暖 2025-02-14 13:12:58

您可能已启用了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.

゛时过境迁 2025-02-14 13:12:58

\ 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.

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