[ 
https://issues.apache.org/jira/browse/IGNITE-17994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Tupitsyn updated IGNITE-17994:
------------------------------------
    Description: 
[HashCalculator converts BigDecimal and BigInteger to double to compute 
hash|https://github.com/apache/ignite-3/blob/fa79ad532b18c3a9cf277d09b4fd0e8cd25775e0/modules/core/src/main/java/org/apache/ignite/internal/util/HashCalculator.java#L152].
 Under the hood this involves weird and complicated logic - bit magic for 
BigInteger, string conversion for BigDecimal.
This logic is too hard to replicate in non-Java clients.

Use toByteArray()  instead to compute the hash. Byte representation of those 
types is used in BinaryTuple already, so clients know how to work with that.

  was:
HashCalculator converts BigDecimal and BigInteger to double to compute hash. 
Under the hood this involves weird and complicated logic - bit magic for 
BigInteger, string conversion for BigDecimal.
This logic is too hard to replicate in non-Java clients.
I propose to use toByteArray()  instead to compute the hash. Byte 
representation of those types is used in BinaryTuple already, so clients know 
how to work with that.


> Use toByteArray for colocation hash of BigDecimal and BigInteger
> ----------------------------------------------------------------
>
>                 Key: IGNITE-17994
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17994
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>
> [HashCalculator converts BigDecimal and BigInteger to double to compute 
> hash|https://github.com/apache/ignite-3/blob/fa79ad532b18c3a9cf277d09b4fd0e8cd25775e0/modules/core/src/main/java/org/apache/ignite/internal/util/HashCalculator.java#L152].
>  Under the hood this involves weird and complicated logic - bit magic for 
> BigInteger, string conversion for BigDecimal.
> This logic is too hard to replicate in non-Java clients.
> Use toByteArray()  instead to compute the hash. Byte representation of those 
> types is used in BinaryTuple already, so clients know how to work with that.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to