添加架构版本 - Amazon Glue
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

添加架构版本

添加架构版本时,您需要比较版本,确保接受新架构。

要为现有架构添加新版本,请使用 RegisterSchemaVersion 操作(Python:register_schema_version) API。

指定 SchemaId 结构,指示要为其添加版本的架构,以及指定 SchemaDefinition 以定义架构。

代码示例 12:

aws glue register-schema-version --schema-definition "{\"type\": \"record\", \"name\": \"r1\", \"fields\": [ {\"name\": \"f1\", \"type\": \"int\"}, {\"name\": \"f2\", \"type\": \"string\"} ]}" --schema-id SchemaArn="arn:aws:glue:us-east-1:901234567890:schema/registryName/testschema"
aws glue register-schema-version --schema-definition "{\"type\": \"record\", \"name\": \"r1\", \"fields\": [ {\"name\": \"f1\", \"type\": \"int\"}, {\"name\": \"f2\", \"type\": \"string\"} ]}" --schema-id SchemaName="testschema",RegistryName="testregistry"
  1. 登录 Amazon Web Services Management Console,然后打开 Amazon Glue 控制台,网址为:https://console.aws.amazon.com/glue/

  2. 在导航窗格的 Data catalog (数据目录) 下,选择 Schemas (架构)

  3. 从方案列表中选择一个方案,方法是选择该方案对应的框。

  4. 从列表中选择一个或多个方案,方法是选择相关方案对应的框。

  5. Action (操作) 菜单中,选择 Register new version (注册新版本)

  6. New version (新版本) 框中,输入或粘贴新架构。

  7. 选择 Compare with previous version (与先前版本比较),查看与先前架构版本的差异。

  8. (可选)选择 Add metadata (添加元数据) 添加版本元数据,对架构版本进行注释或分类。输入 Key (密钥) 和可选 Value (值)

  9. 选择 Register version (注册版本)

添加架构版本。

架构版本在版本列表中显示。如果版本更改了兼容性模式,则该版本将标记为检查点。

架构版本比较示例

当您选择 Compare with previous version (与先前版本比较) 时,您将看到先前版本和新版本一起显示。更改的信息将如下突出显示:

  • 黄色:表示已更改的信息。

  • 绿色:表示在最新版本中添加的内容。

  • 红色:表示在最新版本中删除的内容。

您还可以与早期版本进行比较。

架构版本比较示例。