我如何写一个 java.util.map 到 avro ?在 GenericData 中,我看到了 Record 等的条目,但没有看到 Map 的条目。http://apache-avro.679487.n3.nabble.com/How-to-write-an-AVRO-map-Something-like-GenericData-Map-td3407527.html上也有同样的问题,但我不完全明白它是如何完成的。
我有一个Pojo.avsc包含以下声明的文件:
{
"namespace": "io.fama.pubsub.schema",
"type": "record",
"name": "Pojo",
"fields": [
{
"name": "field",
"type": "string"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我有一个PojoCollection.avsc只包含 Pojo 对象集合的文件。
{
"namespace": "io.fama.pubsub.schema",
"type": "record",
"name": "PojoCollection",
"fields": [
{
"name": "collection",
"type": {
"type": "array",
"items": {
"name": "pojo",
"type": "Pojo"
}
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
我的 avro-maven-plugin 配置如下:
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.8.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<imports>
<import>${basedir}/src/main/avro/Pojo.avsc</import>
</imports>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
这会导致以下异常:
Caused by: org.apache.avro.SchemaParseException: Type not supported: …Run Code Online (Sandbox Code Playgroud) 我正在为带有架构注册表的 java kafka-stream 寻找适当的教程/指南。我有谷歌,但找不到合适的教程。如果有人能帮我找到至少合适的教程,我真的很感激
我可以通过谷歌搜索找到 kafka 流教程。但我正在寻找带有 schemaregistry 的 kafka 流
java avro apache-kafka apache-kafka-streams confluent-schema-registry
I know this is not the first time this question has been asked. As i have gone through several links, but unable to understand why avro schema is not generating the source code when no error is being thrown in maven(eclipse). I have tried deleting 'pluginManagement' from pom.xml file but it throws error.
Run Code Online (Sandbox Code Playgroud)
尝试删除 .m2 repo、mvn clean、mvn install,似乎没有任何效果。不知道是什么问题。
另外,您能否告诉我如何在从命令行生成源代码时添加“fieldVisibility=private”参数。请指导!谢谢!
这是 pom.xml 文件
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>kafka</groupId>
<artifactId>ProducerConsumer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ProducerConsumer</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>1.0.0</version>
</dependency>
<dependency> …Run Code Online (Sandbox Code Playgroud) 我正在使用Avro 1.11.0库使用Python 3.7将数据写入 Avro 文件。我对 Avro 的联合类型有一些疑问。请在下面找到两个架构。
{
"name" : "name",
"type" : ["null", "string"],
"columnName" : "name",
}
{
"name" : "name",
"type" : ["string", "null"],
"columnName" : "name",
}
Run Code Online (Sandbox Code Playgroud)
第一个架构包含联合类型 as "type" : ["null", "string"],第二个架构包含联合类型 as "type" : ["string", "null"]。那么上面提到的模式有什么区别吗?