如何检索 Parquet 中的 Vertica 数据?本地

发布于 2025-01-13 05:01:01 字数 558 浏览 2 评论 0原文

我正在尝试将数据从我的 vertica DB 导出到笔记本电脑的本地存储。这可能吗?

当我尝试目录='C:/Downloads'时,它显示目录未找到错误。

直接在 parquet 中将数据检索到本地的替代方法是什么?

参考文档: https:// www.vertica.com/docs/9.3.x/HTML/Content/Authoring/SQLReferenceManual/Statements/EXPORTTOPARQUET.htm

EXPORT TO PARQUET(directory = 'hdfs:///user3/data') 
 OVER(ORDER BY col1) AS SELECT col1 + col1 AS A, col2
 FROM public.T3;

I'm trying to export data from my vertica DB to my laptop's local storage. Is this possible?

When I tried the directory = 'C:/Downloads' it showed dir not found error.

What's the alternative to directly retrieve data to local in parquet?

Doc for reference : https://www.vertica.com/docs/9.3.x/HTML/Content/Authoring/SQLReferenceManual/Statements/EXPORTTOPARQUET.htm

EXPORT TO PARQUET(directory = 'hdfs:///user3/data') 
 OVER(ORDER BY col1) AS SELECT col1 + col1 AS A, col2
 FROM public.T3;

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

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

发布评论

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

评论(1

内心激荡 2025-01-20 05:01:02

对我有用的唯一方法是导出到 Vertica 节点上的目录,然后将生成的目录 scp 到我的平台(在我的例子中是 Mac M1):

marco ~/1/aaa $ vsql -c "export to parquet (
                   directory='/tmp/d_custym_scd',int96AsTimestamp=false 
                 ) as select * from scd.d_custym_scd"
 Rows Exported 
---------------
            22
(1 row)

marco ~/1/aaa $ scp -r dbadmin@zbook:/tmp/d_custym_scd/ /tmp/
dbadmin@zbook's password: 
aae46ff7-v_sbx_node0001-140499690358528-0.parquet    100% 4605   332.4KB/s   00:00    

如果您无权访问作为 Vertica 节点的 Linux shell 的 dbadmin,请确保 Vertica 节点上存在一个目录,您(作为普通 Linux 用户)可以从中读取内容,并且 scp 创建的目录以以下身份登录该用户而不是数据库管理员。

The only way that worked for me was to export to a directory on a Vertica node, and then scp the generated directory to my platform (a Mac M1 in my case):

marco ~/1/aaa $ vsql -c "export to parquet (
                   directory='/tmp/d_custym_scd',int96AsTimestamp=false 
                 ) as select * from scd.d_custym_scd"
 Rows Exported 
---------------
            22
(1 row)

marco ~/1/aaa $ scp -r dbadmin@zbook:/tmp/d_custym_scd/ /tmp/
dbadmin@zbook's password: 
aae46ff7-v_sbx_node0001-140499690358528-0.parquet    100% 4605   332.4KB/s   00:00    

If you don't have access as dbadmin to a Vertica node's Linux shell, make sure that there exists a directory on the Vertica node exists where you - as an ordinary mortal Linux user - can read from, and scp the created directory logged in as that user instead of dbadmin.

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