Skip to content
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

Kafka SchemaTransform translation #31362

Merged

Conversation

ahmedabu98
Copy link
Contributor

Adding SchemaTransform translation and tests for KafkaIO

@github-actions github-actions bot removed the build label May 21, 2024
Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @kennknowles for label java.
R: @chamikaramj for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@ahmedabu98
Copy link
Contributor Author

R: @chamikaramj
R: @damccorm

Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@chamikaramj chamikaramj added this to the 2.57.0 Release milestone May 28, 2024
Copy link
Contributor

@chamikaramj chamikaramj left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM.

return SchemaRegistry.createDefault()
.getToRowFunction(KafkaReadSchemaTransformConfiguration.class)
.apply(configuration)
.sorted()
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify why this sorting is needed ? Do we need to do this for every implementation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just to keep in line with what TypedSchemaTransformProvider does when producing a config schema:

return SchemaRegistry.createDefault().getSchema(configurationClass()).sorted().toSnakeCase();

This is due to the SchemaProvider not always producing a consistent schema (#24361). So we sort to keep it consistent

Do we need to do this for every implementation

Right now unfortunately yes. I'm working on adding some things to SchemaTransform (#30943) to avoid having to copy this everywhere. My hope is this change will make SchemaTransformTranslation sufficient for all and help avoid needing a SchemaTransformTranslation for each IO.

@ahmedabu98 ahmedabu98 merged commit f2931d3 into apache:master Jun 5, 2024
20 checks passed
ahmedabu98 added a commit that referenced this pull request Jun 5, 2024
* kafka schematransform translation and tests

* cleanup

* spotless

* address failing tests

* switch existing schematransform tests to use Managed API

* fix nullness

* add some more mappings

* fix mapping

* typo

* more accurate test name

* cleanup after merging snake_case PR

* spotless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants