Fixed fastavro not being used if schemas aren't manually specified… #601
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… Don't force fastavro to re-parse from JSON every time; cache the result. Added a flag to disable message key decoding.
As the commit message summarises, this improves a few things. I'll elaborate:
fastavro
would no longer be used by default.fastavro
will no longer be forced to reparse the schema dict for every message.AvroConsumer
optional (but on by default). The main reason for this is that it is not, as far as I can tell, a requirement to encode both for a given topic. One very good reason for only Avro-encoding message values and not keys is that KSQL actually requires this! See Add support for generic message keys (e.g. message keys in Avro or JSON format, STRUCT) ksql#824, for example.Potentially point 3 at least would be superseded by #502, if that's still planned. However, we needed a way of disabling this more immediately. Let me know if you would therefore like me to minimise this PR at all.