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 2020/08/27 19:22:10 UTC

[GitHub] [kafka] avocader opened a new pull request #9227: KAFKA-10439: Connect's Values to parse BigInteger as Decimal with zero scale.

avocader opened a new pull request #9227:
URL: https://github.com/apache/kafka/pull/9227


   The `org.apache.kafka.connect.data.Values#parse` method parses integers, which are larger than `Long.MAX_VALUE` as `double` with `Schema.FLOAT64_SCHEMA`.
   
   That means we are losing precision for these larger integers.
   
   For example:
   ```
   SchemaAndValue schemaAndValue = Values.parseString("9223372036854775808");
   ```
   returns:
   ```
   SchemaAndValue{schema=Schema{FLOAT64}, value=9.223372036854776E18}
   ```
   Also, this method parses values, that can be parsed as `FLOAT32` to `FLOAT64`.
   
   This PR changes parsing logic, to use `FLOAT32`/`FLOAT64` for numbers that don't have and fraction part(`decimal.scale()!=0`) only, and use an arbitrary-precision `org.apache.kafka.connect.data.Decimal` otherwise.
   Also, it updates the method to parse numbers, that can be represented as `float` to `FLOAT64`.
   
   Added unit tests, that cover parsing `BigInteger`, `Byte`, `Short`, `Integer`, `Long`, `Float`, `Double` types.
   
   ### 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.

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



[GitHub] [kafka] avocader closed pull request #9227: KAFKA-10439: Connect's Values to parse BigInteger as Decimal with zero scale.

Posted by GitBox <gi...@apache.org>.
avocader closed pull request #9227:
URL: https://github.com/apache/kafka/pull/9227


   


----------------------------------------------------------------
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.

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



[GitHub] [kafka] kkonstantine closed pull request #9227: KAFKA-10439: Connect's Values to parse BigInteger as Decimal with zero scale.

Posted by GitBox <gi...@apache.org>.
kkonstantine closed pull request #9227:
URL: https://github.com/apache/kafka/pull/9227


   


----------------------------------------------------------------
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.

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



[GitHub] [kafka] kkonstantine commented on pull request #9227: KAFKA-10439: Connect's Values to parse BigInteger as Decimal with zero scale.

Posted by GitBox <gi...@apache.org>.
kkonstantine commented on pull request #9227:
URL: https://github.com/apache/kafka/pull/9227#issuecomment-693533434


   ok to test


----------------------------------------------------------------
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.

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



[GitHub] [kafka] kkonstantine commented on pull request #9227: KAFKA-10439: Connect's Values to parse BigInteger as Decimal with zero scale.

Posted by GitBox <gi...@apache.org>.
kkonstantine commented on pull request #9227:
URL: https://github.com/apache/kafka/pull/9227#issuecomment-693534496


   Closing temporarily to attempt to trigger a jenkins build. 


----------------------------------------------------------------
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.

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



[GitHub] [kafka] avocader closed pull request #9227: KAFKA-10439: Connect's Values to parse BigInteger as Decimal with zero scale.

Posted by GitBox <gi...@apache.org>.
avocader closed pull request #9227:
URL: https://github.com/apache/kafka/pull/9227


   


----------------------------------------------------------------
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.

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