以提供商身份通过 SQL 管理列表 – 示例¶
以下是提供商可以通过 SQL 命令以编程方式完成的常见任务示例:
与另一个 Snowflake 账户共享数据¶
为 MySHARE 创建私密列表,然后立即发布。
描述 |
备注 |
|---|---|
创建针对另一个账户的列表。 |
提交列表以供立即审批(默认为 批准后发布(默认为 |
CREATE EXTERNAL LISTING SHARED_WITH_ANOTHER_ACCOUNT
SHARE MySHARE AS
$$
title: "weather data"
description: "Listing of weather data for all zipcodes in America"
listing_terms:
type: "OFFLINE"
targets:
accounts: ["targetorg.targetaccount"]
$$ PUBLISH=TRUE REVIEW=TRUE;
共享私密列表并复制¶
创建一个私密列表,该列表将自动复制到其他区域。
描述 |
备注 |
|---|---|
创建一个复制的私密列表。 |
复制列表并每 10 分钟刷新一次。 提交列表以供立即审批(默认为 批准后发布(默认为 |
CREATE EXTERNAL LISTING SHARED_AND_REPLICATED
SHARE MySHARE AS
$$
title: "weather data"
description: "Listing containing weather data for all zipcodes in America"
listing_terms:
type: "OFFLINE"
targets:
accounts: ["targetorg.targetaccount"]
auto_fulfillment:
refresh_type: SUB_DATABASE
refresh_schedule: '10 MINUTE'
$$;
有关 Cross-Cloud Auto-Fulfillment 的更多信息,请参阅 列表的自动履行。
在 Marketplace 中公开共享¶
在 Snowflake Marketplace 中创建一个公开列表。
描述 |
备注 |
|---|---|
在 Marketplace 中创建一个复制的公开列表。 将列表复制到多个区域。 |
复制列表并每 10 分钟刷新一次。 提交列表以供立即审批(默认为 批准后发布(默认为 |
CREATE EXTERNAL LISTING PUB_SHARE_AND_REPLICATE
SHARE MySHARE AS
$$
title: "Weather Data"
subtitle: "Weather Data on Snowflake"
description: "This listing contains weather data for all zipcodes in America"
terms_of_service:
type: "STANDARD"
targets:
regions: ["PUBLIC.US_WEST", "PUBLIC.AWS_US_EAST_1"]
auto_fulfillment:
refresh_schedule: "10 MINUTE"
refresh_type: "SUB_DATABASE"
profile: "VERY_STARK_INDUSTRIES_PUBLIC_PROFILE"
categories: ["BUSINESS"]
data_dictionary:
featured:
database: "DATABASE_NAME"
objects:
- schema: "SCHEMA_NAME"
domain: TABLE
name: "TABLE_NAME"
business_needs:
- name: "Data Quality and Cleansing"
description: "Test listing for data cleansing"
usage_examples:
- title: "Aggregate Weather data for a location"
description: "Calculate the minimum and maximum temperatures over a year"
query: "SELECT 1"
data_attributes:
refresh_rate: "HOURLY"
geography:
geo_option: "NOT_APPLICABLE"
resources:
documentation: "https://snowflake.com/doc"
media: "https://www.youtube.com/watch?v=AR88dZG-hwo"
$$;
创建一个准备与另一账户共享的私密列表草稿¶
创建一个自动复制到其他区域的列表草稿。
请注意,此示例与 与另一个 Snowflake 账户共享数据 相同,但创建的是列表草稿。有关 REVIEW 和 PUBLISH 属性的所有组合及其含义的完整说明,请参阅 CREATE LISTING。
描述 |
备注 |
|---|---|
创建一个复制的私密列表。 |
复制列表并每 10 分钟刷新一次。 不提交列表以供审批 ( 不发布 ( |
CREATE EXTERNAL LISTING DRAFT_PRIVATE_REPLICATED
SHARE MySHARE AS
$$
title: "weather data"
description: "Listing containing weather data for all zipcodes in America"
listing_terms:
type: "OFFLINE"
targets:
accounts: ["targetorg.targetaccount"]
auto_fulfillment:
refresh_type: SUB_DATABASE
refresh_schedule: '10 MINUTE'
$$ PUBLISH=FALSE REVIEW=FALSE;