如何在不指定红移中指定列的情况下创建外部表?

发布于 2025-01-29 03:44:56 字数 140 浏览 1 评论 0原文

我有一个包含镶木格式的文件的文件夹。我使用Crawler创建了胶水数据目录中定义的表,该表数计算为2500多列。我想用红移在其顶部创建外部表。
但是我阅读的所有文章都明确提到了这些列。 有什么方法是为了使表直接从数据目录中的表中读取模式,而我不必单独喂食它?

I have a folder containing files in parquet format. I used crawler to create table defined in Glue Data Catalog which counted to 2500+ columns. I want to create External Table on top of it in redshift.
But all the articles that I read have mentioned the columns explicitly.
Is there any way so that the Table reads schema directly from the table in data catalog and I don't have to feed it separately?

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

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

发布评论

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

评论(1

旧竹 2025-02-05 03:44:56

您可以创建外部架构在基于数据目录的红移中。这样,您将在数据目录中看到所有表,而无需在红移中创建它们。

create external schema spectrum_schema
from data catalog 
database 'spectrum_db' 
iam_role 'arn:aws:iam::123456789012:role/MySpectrumRole'
create external database if not exists;

在文档中的上面示例中,spectrum_db是您的数据目录的名称。

You can create an external schema in Redshift which is based on a data catalog. This way, you will see all tables in the data catalog without creating them in Redshift.

create external schema spectrum_schema
from data catalog 
database 'spectrum_db' 
iam_role 'arn:aws:iam::123456789012:role/MySpectrumRole'
create external database if not exists;

In the above example from the documentation, spectrum_db is the name of your data catalog.

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