Skip to content

Conversation

@haiminh87
Copy link

  • When we read data from Kafka, we want to always read with the latest schema.
  • This allows us to make assumption throughout the rest of the pipeline that every record has the same schema.
  • We create a custom KafkaAvroDecoder that use the latest schema as read schema.
  • This does not work with all SchemaProvider yet.

- When we read data from Kafka, we want to always read with the latest schema.
- This allows us to make assumption throughout the rest of the pipeline that every record has the same schema.
- We create a custom KafkaAvroDecoder that use the latest schema as read schema.
@vinothchandar vinothchandar added the status:in-progress Work in progress label Jul 8, 2019
@vinothchandar
Copy link
Member

cc @pratyakshsharma this has been around for long.. Could you take a look to understand if we still need this and may be retarget this for the next release

@pratyakshsharma
Copy link
Contributor

ack. Will take a pass.


private final Schema sourceSchema;

public SourceSchemaKafkaAvroDecoder(VerifiableProperties props) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason why you are using VerifiableProperties here and not TypedProperties?

return super.deserialize(includeSchemaAndVersion, topic, isKey, payload, readerSchema);
}

return super.deserialize(includeSchemaAndVersion, topic, isKey, payload, sourceSchema);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haiminh87 I was thinking if we could make this configurable in sense that have a boolean like readUsingLatestSchema with a default value of true and can be overridden via TypedProperties instance.

this.configure(new KafkaAvroDeserializerConfig(props.props()));

TypedProperties typedProperties = new TypedProperties();
copyProperties(typedProperties, props.props());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do away with this function?

@pratyakshsharma
Copy link
Contributor

@haiminh87 Thank you for submitting this PR. Have left few comments. Apart from them, this PR needs a rebase and it would be great if we could add test cases as well. :)

@pratyakshsharma
Copy link
Contributor

cc @pratyakshsharma this has been around for long.. Could you take a look to understand if we still need this and may be retarget this for the next release

@vinothchandar this is a good feature to have. Have left few comments.

Copy link
Contributor

@pratyakshsharma pratyakshsharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us add test cases, and rebase once @haiminh87

@pratyakshsharma
Copy link
Contributor

@haiminh87 Still working on this?

@vinothchandar
Copy link
Member

@pratyakshsharma Nope.. all yours if you want to take a run at it

@pratyakshsharma
Copy link
Contributor

@pratyakshsharma Nope.. all yours if you want to take a run at it

Sure, will be working on it next then :)

@pratyakshsharma
Copy link
Contributor

@vinothchandar I raised #1562 for this feature. I guess we can close this PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:in-progress Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants