You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "shibd (via GitHub)" <gi...@apache.org> on 2024/03/28 10:31:35 UTC

[PR] [improve][io]: Add validation for JDBC sink not supporting primitive schema [pulsar]

shibd opened a new pull request, #22376:
URL: https://github.com/apache/pulsar/pull/22376

   ### Motivation
   Currently implemented for `JdbcAutoSchemaSink` connector,  It utilizes `GenericRecord.getField` to find fields with the same table column names. 
   
   https://github.com/apache/pulsar/blob/849cbf3a46cc7e85fca6500c08ab6efb8697f12e/pulsar-io/jdbc/core/src/main/java/org/apache/pulsar/io/jdbc/BaseJdbcAutoSchemaSink.java#L140
   
   However, the return value of the [primitive type](https://github.com/apache/pulsar/blob/82237d3684fe506bcb6426b3b23f413422e6e4fb/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/GenericObjectWrapper.java#L63-L65) schema is always null. This results in null data being inserted into the table, thereby causing errors.
   
   ### Modifications
   - For the primitive type of schema, throw a clear exception to inform the user that it is not supported.
   
   ### Verifying this change
   - Add `testNotSupportPrimitiveSchema ` to cover it.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


Re: [PR] [improve][io]: Add validation for JDBC sink not supporting primitive schema [pulsar]

Posted by "shibd (via GitHub)" <gi...@apache.org>.
shibd merged PR #22376:
URL: https://github.com/apache/pulsar/pull/22376


-- 
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: commits-unsubscribe@pulsar.apache.org

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