我正在尝试使用这个 avro 模式
{
"type": "record",
"name": "ComplianceEntity",
"namespace": "com.linkedin.events.metadata",
"fields": [
{
"name": "fieldPath",
"type": "string"
},
{
"name": "complianceDataType",
"type": {
"type": "enum",
"name": "ComplianceDataType",
"symbols": [
"NONE",
"MEMBER_ID"
],
"symbolDocs": {
"NONE": "None of the following types apply",
"MEMBER_ID": "ID for LinkedIn members"
}
}
},
{
"name": "complianceDataTypeUrn",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "fieldFormat",
"type": [
"null",
{
"type": "enum",
"name": "FieldFormat",
"symbols": [
"NUMERIC"
],
"symbolDocs": {
"NUMERIC": "Numerical format, 12345"
},
"doc": "The field format"
}
]
},
{
"name": "securityClassification",
"type": "SecurityClassification"
},
{
"name": "valuePattern",
"default": null,
"type": [
"null",
"string"
]
}
]
}
使用 avro-tools 生成和 avro 文件:
java -jar ./avro-tools-1.8.2.jar compile schema ComplianceEntity.avsc .
但我收到以下错误消息:
线程“main”org.apache.avro.SchemaParseException 中的异常:“SecurityClassification”不是定义的名称。“securityClassification”字段的类型必须是定义的名称或 {“type”: ...} 表达式。
谁能告诉,为什么 SecurityClassification 没有被识别为定义的名称?