linkedin / avro-util

Collection of utilities to allow writing java code that operates across a wide range of avro versions.
BSD 2-Clause "Simplified" License
76 stars 59 forks source link

Add option in SchemaBuilder to ignore user defined json properties during codegen. #542

Closed li-ukumar closed 8 months ago

li-ukumar commented 9 months ago

What

Adding option to ignore json properties in SchemaBuilder

Why

During avro codegen, the if the generator detects conflicting defintions of a schema, where the filesystem definition is different from the one in classpath, it throws. Relaxing this check by allowing the user to specify json properties to be ignored during this check.

It is useful if the duplicate schema is "almost" same but has certain properties which may store metadata for another flow.

Test

Added Sanity Unit test build

codecov-commenter commented 9 months ago

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (f46f720) 46.15% compared to head (6656ce6) 46.17%. Report is 1 commits behind head on master.

Files Patch % Lines
...1/compatibility/SchemaComparisonConfiguration.java 52.00% 12 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #542 +/- ## ============================================ + Coverage 46.15% 46.17% +0.02% - Complexity 4534 4545 +11 ============================================ Files 407 407 Lines 28393 28447 +54 Branches 4633 4634 +1 ============================================ + Hits 13104 13135 +31 - Misses 13721 13748 +27 + Partials 1568 1564 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

karthikrg commented 9 months ago

I don't advise doing this. If folks rely on reading these properties from runtime schema they may get nasty surprises.