Comments (6)
Also it seems that if i write with a SpecificRecord, i must read with one, and like wise if i write with a GenericRecord, i must read with one.
This will cause issues, where an app produces with specific and another consumes without the specific (aka some generic integration) and vice-versa.
Should not serial/deserialize to Generic/Specific based on how an array is written, but based on if the app has a SpecificRecord on the CP or not. (similar to confluents)
int recordType = payloadInputStream.read();
LOG.debug("Received record type: [{}]", Integer.valueOf(recordType));
Object datumReader = null;
Schema readerSchema = readerSchemaVersion != null?(Schema)this.getSchema(new SchemaVersionKey(schemaName, readerSchemaVersion)):null;
if(recordType == 0) {
datumReader = readerSchema != null?new GenericDatumReader(e, readerSchema):new GenericDatumReader(e);
} else {
datumReader = readerSchema != null?new SpecificDatumReader(e, readerSchema):new SpecificDatumReader(e);
}
from registry.
I have raised a PR to hopefully address this.
it would be good if this could make next release (due soon i believe reading google groups), as this is blocking us currently.
from registry.
@michaelandrepearce Which version id should be set for KafkaAvroDeserializer?
+1 to be flexible for consuming either specific record or generic record on deserializer side. We can target addressing this issue in upcoming release.
from registry.
For what you serialize into for specific it's redundant, as specefic it should take the schema of what's on concrete class on the class path.
For generic if not provided / present you simply don't evolve and you serialize into generic record using the inbound version.
For generic if provided then you can evolve as you serialize into generic record
This is a key point here.
from registry.
See the pr, This is all the same logic that's in the confluent serdes also.
from registry.
Logic to deal with if no readerSchema (aka no reader version id)
+ private DatumReader getDatumReader(Schema writerSchema, Schema readerSchema) {
+ if(this.useSpecificAvroReader) {
+ if(readerSchema == null) {
+ readerSchema = this.getReaderSchema(writerSchema);
+ }
+
+ return new SpecificDatumReader(writerSchema, readerSchema);
+ } else {
+ return readerSchema == null?new GenericDatumReader(writerSchema):new GenericDatumReader(writerSchema, readerSchema);
+ }
+ }
from registry.
Related Issues (20)
- Remove all server-side caches from Schema Registry
- Upgrade Scala to 2.13.10 due to CVE-2022-36944
- Support deserialization when the topic and schema names don't match
- SchemaVersionProtocolHandlerTest is flaky
- Upgrade Dropwizard to the latest version
- support for auto register schemas via properties HOT 1
- Make jar signing optional in the build.
- Support rolling upgrade
- Fix compile error in JsonSerDesHandlerTest
- Exclude vulnerable snakeyaml from Schema Registry libs
- Change the format of mTLS principal mapping rules to be consistent with kafka
- Schema Registry Client does not update its cache when a schema version deleted
- SR client SchemaVersionInfoCache is not thread safe
- Schema registry migrate k8s /ci tests to testcontainer setup
- Schema fingerprinting handles union ordering as distinctive feature
- SR server does not handle SchemaParseException properly
- SR client SchemaMetadataCache leaks memory
- SR server does not handle SchemaParseException properly
- high concurrency r/w trigger the full table scan which got stuck
- Hortonwork Schema Registry 1.0.0 (Invalid POM) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from registry.