This name combines "Avro" and "Jnaana" (meaning "knowledge" or "wisdom" in Sanskrit)
to suggest a project focused on understanding and mastering the use of logical types in Apache Avro.
This is a companion code repo for the Apache Avro series of articles. The articles will cover the below topics:
Here is the link to the Avrodoc of the schemas that the repo currently has:
When you define avro schemas or models or contracts for a particular dataset or domain, we have a limited set of data types available.
What if there is a field which needs to be encrypted? What if there is a field which needs to be transformed in a different way?
Logical Types to the rescue.
By defining custom logical types, we can handle such usecases. This code repo has examples of that.
Some of the questions it will help answer right away:
QueryRecord schema
Used for testing.
CustomerObjectModel
My take on a generic Customer Model of a retail store.
Build project
gradle clean build
Generate Schema files
gradle schemas:generateSchema
Build Avrodoc
gradle schemas:generateAvroDoc
The avro schemas are represented in a html file making it easy to search and understand the schema.
QueryRecordOutput.java
and verify the logs.Read more at Test with Kafka
Read more at Schema Registry
Click here to look at the Unit test results
Generated by the command
tree -r -I 'node_modules|bin|package*|java_*'
├── src
│ ├── test
│ │ ├── resources
│ │ └── java
│ └── main
│ ├── resources
│ └── java
│ └── com
│ └── lavro
│ ├── QueryRecordOutput.java
│ ├── ProducerDemo.java
│ ├── CustomerObjectModelOutput.java
│ └── ConsumerDemo.java
├── settings.gradle
├── schemas
│ ├── src
│ │ ├── test
│ │ │ ├── resources
│ │ │ └── java
│ │ └── main
│ │ ├── resources
│ │ ├── java
│ │ │ └── com
│ │ │ └── lavro
│ │ └── avro
│ │ ├── query.avdl
│ │ ├── SimpleOrder.avdl
│ │ ├── SimpleCustomer.avdl
│ │ ├── CustomerObjects.avdl
│ │ └── CustomerObjectModel.avdl
│ └── build.gradle
├── schema-registry
│ └── results
│ └── registered.csv
├── query.avro
├── kafka.md
├── gradlew.bat
├── gradlew
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.properties
│ └── gradle-wrapper.jar
├── docs
│ ├── ecommerce.png
│ ├── ecommerce.drawio
│ └── avrodoc
│ └── avrodoc.html
├── custom-conversions
│ ├── src
│ │ ├── test
│ │ │ ├── resources
│ │ │ └── java
│ │ └── main
│ │ ├── resources
│ │ └── java
│ │ └── com
│ │ └── lavro
│ │ ├── ReversedLogicalTypeFactory.java
│ │ ├── ReversedLogicalType.java
│ │ ├── ReversedConversion.java
│ │ ├── EncryptedLogicalTypeFactory.java
│ │ ├── EncryptedLogicalType.java
│ │ └── EncryptedConversion.java
│ └── build.gradle
├── config
│ ├── xsl
│ │ └── checkstyle-custom.xsl
│ └── checkstyle
│ ├── suppressions.xml
│ └── checkstyle.xml
├── build.gradle
└── README.md
Language: Java
Build Tool: Gradle