You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS Glue Schema Registry是否支持Avro自定义类型跨Schema复用?

Avro自定义类型跨Schema复用:AWS Glue Schema Registry支持情况咨询

已实现的本地复用方案(基于avro-maven-plugin)

我已经通过avro-maven-plugin实现了Avro Schema之间自定义类型的复用,具体配置和Schema示例如下:

1. 共享自定义类型Schema

文件路径:shared/child_type.avsc

{ "namespace": "my.namespace", "type": "record", "name": "ChildType", "fields": [ ... ] }

2. 依赖自定义类型的父Schema

文件路径:parent_type.avsc(其中字段field_of_custom_type引用了自定义类型)

{ "namespace": "my.namespace", "type": "record", "name": "ParentType", "fields": [ { "name": "field_of_custom_type", "type": "my.namespace.ChildType" } ] }

3. Maven插件配置(核心是imports配置)

<plugin>
  <groupId>org.apache.avro</groupId>
  <artifactId>avro-maven-plugin</artifactId>
  <version>${avro.version}</version>
  <configuration>
    <sourceDirectory>${avro.sourceDirectory}</sourceDirectory>
    <outputDirectory>${avro.outputDirectory}</outputDirectory>
    <imports>
      <import>${avro.sourceDirectory}/shared</import>
    </imports>
  </configuration>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>schema</goal>
      </goals>
    </execution>
  </executions>
</plugin>

我了解到Confluent Schema Registry支持这类跨Schema复用自定义类型的特性,但不确定AWS Glue Schema Registry是否同样支持该功能?

在尝试将这种复用方式应用到AWS Glue Schema Registry时,我遇到了以下报错:

InvalidInputException: Schema definition is invalid: "my.namespace.ChildType" is not a defined name. The type of the "field_of_custom_type" field must be a defined name or a {"type": ...} expression.


内容的提问来源于stack exchange,提问作者Sigoy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 04:42:34