如何通过boto3在红移集群中创建表

发布于 2025-02-10 07:05:06 字数 847 浏览 1 评论 0原文

我们有一个用例,在我们的AWS帐户中有多个群集,其中一个我们想使用模式创建一个表,

( 
    marketplaceId    integer ,
    cohort    varchar(90) ,
    segment    varchar(90) ,
    eventName    varchar(90) ,
    propensity_bin_id    integer ,
    run_date    varchar(90) ,
    model_version    integer ,
    customer_id    numeric(38,0) ,
    event_date    date ,
    role    varchar(90) ,
    dsi_split    varchar(90) ,
    target_metric    varchar(90) ,
    horizon    varchar(90) ,
    actual_target_value    numeric(38,5) ,
    predicted_baseline_value    numeric(38,5) ,
    predicted_treatment_value    numeric(38,5) ,
    winsorized_residual_value    numeric(38,5) ,
    residual_variance    numeric(38,5) ,
    is_valid    integer ,
    run_id    varchar(90) ,
    occurrence    varchar(90)  
 );

我们可以通过Boto Client创建此表,我找不到相同的任何文档。对此的任何帮助将非常有帮助

We have a use case, where we have multiple cluster in our AWS account, in one of them we want to create a table with a schema

( 
    marketplaceId    integer ,
    cohort    varchar(90) ,
    segment    varchar(90) ,
    eventName    varchar(90) ,
    propensity_bin_id    integer ,
    run_date    varchar(90) ,
    model_version    integer ,
    customer_id    numeric(38,0) ,
    event_date    date ,
    role    varchar(90) ,
    dsi_split    varchar(90) ,
    target_metric    varchar(90) ,
    horizon    varchar(90) ,
    actual_target_value    numeric(38,5) ,
    predicted_baseline_value    numeric(38,5) ,
    predicted_treatment_value    numeric(38,5) ,
    winsorized_residual_value    numeric(38,5) ,
    residual_variance    numeric(38,5) ,
    is_valid    integer ,
    run_id    varchar(90) ,
    occurrence    varchar(90)  
 );

Can we create this table via boto client, I am unable to find any documentation for the same. Any help on this would be super helpful

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

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

发布评论

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

评论(1

晨与橙与城 2025-02-17 07:05:06

要执行此操作,您需要发布SQL命令创建表,并且由于您想通过BOTO(而不是与数据库的JDBC或ODBC连接)进行此操作,因此您需要设置Redshift Data API。请参阅:

https:///docs.aws.aws.amazon.com/ redshift/最终/mgmt/data-api.html

和有关使用它的boto3信息:

https://boto3.amazonaws.com/v1/documentation/api/latest/latest/reference/reference/services/redshift-data.hta.hta.html

https:// https:///docs.aws.aws.aws.aws.amazon.com/redshift/latest/latest/latest/latest/ dg/r_create_table_new.html

请注意,要使用Redshift Data API,您将需要配置群集以启用它并在IAM中设置正确的角色和权限。

To perform this you will need to issue the SQL command CREATE TABLE and since you want to do this through boto (not a JDBC or ODBC connection to the database) you will need to set up Redshift Data API. See:

https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html

and the boto3 information about using it at:

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift-data.html

Redshift CREATE TABLE reference:

https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html

Be aware that to use Redshift Data API you will need to configure you cluster to enable it and set up the correct roles and permissions in IAM.

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