You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/05 12:57:55 UTC

[GitHub] [kafka] pan3793 opened a new pull request, #12126: KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json

pan3793 opened a new pull request, #12126:
URL: https://github.com/apache/kafka/pull/12126

   See details on KAFKA-8713 and KIP-581
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] rayokota commented on pull request #12126: KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json

Posted by GitBox <gi...@apache.org>.
rayokota commented on PR #12126:
URL: https://github.com/apache/kafka/pull/12126#issuecomment-1178039321

   The fix is not quite correct.  You need to conditionally call `struct.getWithoutDefault(field.name())`.  You should also add a test using a struct.  See the corresponding fix for the JSON Schema converter in https://github.com/confluentinc/schema-registry/pull/2326


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] fuxinhao-crypto commented on pull request #12126: KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json

Posted by GitBox <gi...@apache.org>.
fuxinhao-crypto commented on PR #12126:
URL: https://github.com/apache/kafka/pull/12126#issuecomment-1313233055

   @rayokota sorry for bothering you. I'm trying to maintain my own version of `JsonConverter`. I just copied the code and pasted it to a new class `JsonConverter`. and I replaced the following line  https://github.com/a0x8o/kafka/blob/283d07f9d2577e78b7aab7a419818cf9cda19d0a/connect/json/src/main/java/org/apache/kafka/connect/json/JsonConverter.java#L664
   
   to 
   
   ```java
   obj.set(field.name(), this.convertToJson(field.schema(), struct.getWithoutDefault(field.name())));
   ```
   
   Then I changed my debezium config to 
   
   ```
           ...
           "key.converter": "org.apache.kafka.connect.json.MyJsonConverter",
           "key.converter.schemas.enabled": true,
           "value.converter": "org.apache.kafka.connect.json.MyJsonConverter",
           "value.converter.schemas.enabled": true,
   ```
   
   but seems it still does not work. do u know why? what else do I need to do?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] blueberrysugarhigh commented on pull request #12126: KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json

Posted by "blueberrysugarhigh (via GitHub)" <gi...@apache.org>.
blueberrysugarhigh commented on PR #12126:
URL: https://github.com/apache/kafka/pull/12126#issuecomment-1402996186

   > @rayokota sorry for bothering you. I'm trying to maintain my own version of `JsonConverter`. I just copied the code and pasted it to a new class `JsonConverter`. and I replaced the following line
   > 
   > https://github.com/a0x8o/kafka/blob/283d07f9d2577e78b7aab7a419818cf9cda19d0a/connect/json/src/main/java/org/apache/kafka/connect/json/JsonConverter.java#L664
   > 
   > to
   > 
   > ```java
   > obj.set(field.name(), this.convertToJson(field.schema(), struct.getWithoutDefault(field.name())));
   > ```
   > 
   > Then I changed my debezium config to
   > 
   > ```
   >         ...
   >         "key.converter": "org.apache.kafka.connect.json.MyJsonConverter",
   >         "key.converter.schemas.enabled": true,
   >         "value.converter": "org.apache.kafka.connect.json.MyJsonConverter",
   >         "value.converter.schemas.enabled": true,
   > ```
   > 
   > but seems it still does not work. I still got default value with an nullable field. do u know why? what else do I need to do?
   
   Have you been able to make this work ? I just ran into the same issue. I upgraded my schema registry version and tried using the configuration in the connector, but it still was showing the wrong data. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] rayokota commented on pull request #12126: KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json

Posted by "rayokota (via GitHub)" <gi...@apache.org>.
rayokota commented on PR #12126:
URL: https://github.com/apache/kafka/pull/12126#issuecomment-1403014501

   @blueberrysugarhigh , sorry I'm not the author of this PR and I haven't tried it myself.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on PR #12126:
URL: https://github.com/apache/kafka/pull/12126#issuecomment-1923768711

   This has been implemented in https://github.com/apache/kafka/pull/13419. Closing this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] FX-HAO commented on pull request #12126: KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json

Posted by GitBox <gi...@apache.org>.
FX-HAO commented on PR #12126:
URL: https://github.com/apache/kafka/pull/12126#issuecomment-1305162071

   may I ask if there's any progress?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison closed pull request #12126: KAFKA-8713 KIP-581: Add new conf serialize.accept.optional.null in connect-json
URL: https://github.com/apache/kafka/pull/12126


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org