[ 
https://issues.apache.org/jira/browse/KAFKA-4404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15665817#comment-15665817
 ] 

Andy Bryant edited comment on KAFKA-4404 at 11/15/16 2:40 AM:
--------------------------------------------------------------

Hi Ewen

I'd actually be fine with Kafka Connect only supporting signed numeric values, 
however this should be made obvious in the API. I couldn't see any reference to 
what Schema.INT32 referred to in the docs or code.

I ran into an issue with the Confluent kafka-connect-jdbc connector where an 
unsigned integer caused failures. See 
https://github.com/confluentinc/kafka-connect-jdbc/issues/165. If the Schema 
type was specific about it being signed, then connect developers should be made 
aware they need to think about it.

In this case, they could check the metadata and read the unsigned int with 
resultSet.getLong. 
There's actually more than one of these issues with the kafka-connect-jdbc 
connector. For instance the SQL TINYINT type is 0..255 which will cause 
resultSet.getByte to fail half the time.




was (Author: kiwiandy):
Hi Ewen

I'd actually be fine with Kafka Connect only supporting signed numeric values, 
however this should be made obvious in the API. I couldn't see any reference to 
what Schema.INT32 referred to in the docs or code.

I ran into an issue with the Confluent kafka-connect-jdbc connector where an 
unsigned integer caused failures. See 
https://github.com/confluentinc/kafka-connect-jdbc/issues/165. If the Schema 
type was specific about it being signed, then connect developers should be made 
aware they need to think about it.

In this case, they could check the metadata and ready the unsigned int with 
resultSet.getLong. 
There's actually more than one of these issues with the kafka-connect-jdbc 
connector. For instance the SQL TINYINT type is 0..255 which will cause 
resultSet.getByte to fail half the time.



> Add knowledge of sign to numeric schema types
> ---------------------------------------------
>
>                 Key: KAFKA-4404
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4404
>             Project: Kafka
>          Issue Type: Improvement
>          Components: KafkaConnect
>    Affects Versions: 0.10.0.1
>            Reporter: Andy Bryant
>            Assignee: Ewen Cheslack-Postava
>            Priority: Minor
>
> For KafkaConnect schemas there is currently no concept of whether a numeric 
> field is signed or unsigned. 
> Add an additional `signed` attribute (like optional) or make it explicit that 
> numeric types must be signed.
> You could encode this as a parameter on the schema but this would not be 
> standard across all connectors.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to