Questions tagged [jackson-dataformat-avro]

Anything related to Jackson extension component for reading and writing data encoded using Apache Avro data format

Jackson extension component for reading and writing data encoded using Apache Avro strongly Schema-based data format.

project on GitHub

26 questions
6
votes
1 answer

how to properly convert avro schema into a json schema

I have the following json data object: { "name": "John", "favorite_number": 5, "favorite_color" : "green" } The JSON schema for this object looks like this: { "$schema": "http://json-schema.org/draft-04/schema#", "title":…
Eugene Goldberg
  • 14,286
  • 20
  • 94
  • 167
2
votes
0 answers

Define Avro Schema with fixed values

I am trying to define an general Avro Schema for a type of message-data I am transporting across Kafka. Some example data could be like this: "REDHEAD BIGBODY SLIMLEGS 53" "BLUEHEAD NOBODY NONE 7" Which roughly translates to a…
zzlyn
  • 85
  • 1
  • 3
  • 9
2
votes
1 answer

How to deserialize an Avro file using Jackson?

Avro can store batches of serialized object in a single file ("object container file"). Avro supports deserialization to avro-generated java classes or to java bean-style objects, which are both too restrictive in my opinion. I'd love to use Jackson…
Tom
  • 1,414
  • 12
  • 21
2
votes
1 answer

Error in jackson-dataformat-avro

This is my main class: public static void main(String arg[]) throws JsonProcessingException { Address a = new Address("Jln Koli", "90121", "Vila", "Belgium"); Person p = new Person("Ali Bin Baba", new Date(), 90.0, 12, a); List
Auf
  • 473
  • 2
  • 5
  • 9
1
vote
1 answer

How generate Avro Schema with Jackson without Java types

I am currently trying to generate a schema using the Avro Generator from Jackson. I'm surprised that there are many Java classes in the schema. I'm not an avro expert, but the format looks kind of weird and not correct DTO: public class TestDto { …
MelleD
  • 657
  • 1
  • 9
  • 23
1
vote
1 answer

Error register jackson avro schema with confluent cloud schema registry client

I generate an Avro schema from a POJO using Jackson and serialize it. This works quite well so far with the help of Jackson. However, I cannot upload this schema to the schema registry using the Cached Schema registry. Test setup is with…
1
vote
1 answer

Serialize a JSON String to Avro Object that has Union Fields

I have two Avro schemas, one contains several union fields, and the union type is ["null", "string"]. The other schema does not have any union fields. And I have POJO classes representing the mentioned two schemas. POJOs were generated by the…
Prasad
  • 83
  • 1
  • 8
1
vote
0 answers

How to have a Json field in AVRO?

I have a json record like the one below -: val warningJson = """{"p1":"{"trasanction_id": 197, "customer_id": 27, "datetime": "1576499008876", "amount": 6094, "state": "SUCCESS"}","p2":"{"trasanction_id": 197, "customer_id": 27, "datetime":…
Anish Sarangi
  • 172
  • 1
  • 14
1
vote
0 answers

How to custom serialize/deserialize date field while dealing with AVRO format?

I'm facing a very weird problem when dealing with date fields while serializing and deserializing the data in AVRO format. We have a JPA entity defined as follows @Entity public class Person implements Serializable{ @Column(name = "DOB") …
1
vote
1 answer

Creating objects from Primitive avro schema

Suppose I have a schema in avro like this { "type" : "string" } How should i create object from this schema in java?
1
vote
1 answer

Avro Schema Generation - Object Reordering

I need to generate an AVRO schema from an existing Java Model. I then want to use that schema to generate Java objects so I can replace my existing model with the generated one, making the schema the source of truth. I am having a problem which I…
mixiul__
  • 395
  • 1
  • 2
  • 12
1
vote
3 answers

How can i exclude avro namespace when converting to json

Recently i am writing the mapper for pushing data to elasticsearch. My input is avro object where i am trying to convert to Json. Every thing is fine but i am getting namespace in json, where elasticsearch wont allow namespace as key…
pavan
  • 334
  • 6
  • 20
1
vote
1 answer

Spark-Sql Context having dataframe cannot save file in parquet file Due to Deserialazation error

Hi I am reading parquet files in spark context and then merging schema of various parquet files. I am then saving the dataframe returned from read parquet function and saving using write.parquet command. Here is the code: …
0
votes
0 answers

Is there a way to define avro schema file ( .avsc file ) that generates a POJO with a 'Set' member variable?

So I am using Apache Avro ( version 1.11.2 ) to serialize and deserialize data. Here's how my POJO that I want to serialize looks like @Data @AllArgsConstructor @NoArgsConstructor public class MyPojo { private String param1; private String…
0
votes
0 answers

How to prevent org.apache.avro.AvroTypeException: Unknown union branch after making a field nullable?

We changed a field to allow null and now previous json don't work anymore returning a AvroTypeException: Unknown union branch. Here the previous (working) avro file and json for the test: myobject.avsc { "namespace":"my.model.kafka.test", …
Chris
  • 1,080
  • 20
  • 44
1
2