-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support passing schema definition for JSON and AVRO schemas #3766
Conversation
*Motivation* Currently AVRO and Schema generated schemas from POJO directly. Sometime people would like to use pre-generated/defined schemas, so allow passing in schema definitions would clear the confusions on parsing schemas from POJO. *Modifications* - Abstract a common base class `StructSchema` for AVRO/PROTOBUF/JSON - Standarize on using avro schema for defining schema (we already did that. this change only makes it clearer) - Add methods to pass schema definition for JSON and AVRO schemas *NOTES* We don't support passing schema definition for PROTOBUF. since we only supported generated messages as POJO class for protobuf schema, and we generate schema definition from the generated messages. it doesn't make sense to pass in a different schema definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over all lgtm +1
run java8 tests |
1 similar comment
run java8 tests |
@jiazhai I was waiting for #3752 to be merged first, since #3752 will introduce |
Pushing to 2.3.1 since #3752 was marked fro 2.3.1 and it now depends on this one |
* Support passing schema definition for JSON and AVRO schemas *Motivation* Currently AVRO and Schema generated schemas from POJO directly. Sometime people would like to use pre-generated/defined schemas, so allow passing in schema definitions would clear the confusions on parsing schemas from POJO. *Modifications* - Abstract a common base class `StructSchema` for AVRO/PROTOBUF/JSON - Standarize on using avro schema for defining schema (we already did that. this change only makes it clearer) - Add methods to pass schema definition for JSON and AVRO schemas *NOTES* We don't support passing schema definition for PROTOBUF. since we only supported generated messages as POJO class for protobuf schema, and we generate schema definition from the generated messages. it doesn't make sense to pass in a different schema definition. * Add missing license header
Merged in 2.3.1 at |
Motivation
Currently AVRO and Schema generated schemas from POJO directly.
Sometime people would like to use pre-generated/defined schemas,
so allow passing in schema definitions would clear the confusions
on parsing schemas from POJO.
Modifications
StructSchema
for AVRO/PROTOBUF/JSONNOTES
We don't support passing schema definition for PROTOBUF. since we only supported generated messages as POJO
class for protobuf schema, and we generate schema definition from the generated messages. it doesn't make sense
to pass in a different schema definition.
Related Issues: #3752 #3741
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation