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-8713: JsonConverter replace.null.with.default should apply to Struct fields #13781

Merged
merged 1 commit into from May 31, 2023

Conversation

gharris1727
Copy link
Contributor

The "replace.null.with.default" option is a KIP-581 addition that is intended to (when false) prevent the Connect default values from being emitted in the JsonConverter. The current implementation works for root values, but does not work for Structs, as the Struct::get implementation has logic to substitute the default value if no value is present.

Instead, the JsonConverter should call Struct::getWithoutDefault, and hide the default value for Struct fields when "replace.null.with.default" is false.

This should be backported to 3.5
Supersedes #13748

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

…itting default for Struct fields

Signed-off-by: Greg Harris <greg.harris@aiven.io>
Co-authored-by: GeunJae Jeon (krespo) (louis.ii) <>
@gharris1727
Copy link
Contributor Author

cc @mimaison @C0urante @krespo

@jlprat jlprat added the connect label May 31, 2023
Copy link
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR

@mimaison mimaison merged commit 1957be1 into apache:trunk May 31, 2023
1 check failed
mimaison pushed a commit that referenced this pull request May 31, 2023
…itting default for Struct fields (#13781)

Co-authored-by: GeunJae Jeon <krespo>
Reviewers: Mickael Maison <mickael.maison@gmail.com>
emissionnebula added a commit to confluentinc/kafka that referenced this pull request Jun 16, 2023
…tream-3.5

* commit 'c2f6f29ca6e1306ac77ec726bac4cd09bd1aa80b': (76 commits)
  KAFKA-15019: Improve handling of broker heartbeat timeouts (apache#13759)
  KAFKA-15003: Fix ZK sync logic for partition assignments (apache#13735)
  MINOR: Add 3.5 upgrade steps for ZK and KRaft (apache#13792)
  KAFKA-15010 ZK migration failover support (apache#13758)
  KAFKA-15017 Fix snapshot load in dual write mode for ClientQuotas and SCRAM  (apache#13757)
  MINOR: Update LICENSE-binary following snappy upgrade (apache#13791)
  Upgrade to snappy v1.1.10.0 (apache#13786)
  KAFKA-15004: Fix configuration dual-write during migration (apache#13767)
  KAFKA-8713: JsonConverter replace.null.with.default should prevent emitting default for Struct fields (apache#13781)
  KAFKA-14996: Handle overly large user operations on the kcontroller (apache#13742)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants