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

David Capwell updated CASSANDRA-18530:
--------------------------------------
    Description: 
Found by CASSANDRA-18504

When converting the BB to comparable bytes, converting back returns a different 
set of bytes for OSS42

{code}
java.lang.AssertionError: Property falsified after 18 example(s) 
Smallest found falsifying value(s) :-
Type:
decimal
Values: [-9.05674E-92]
Cause was :-
org.junit.ComparisonFailure: [fromComparableBytes(asComparableBytes(bb)) != bb; 
version OSS42] expected:<"0000006[1f22e36]"> but was:<"0000006[2ff75ce1c]">
{code}

EDIT:

After more testing and talking with [~blambov], this is expected behavior and 
been this way since at least 3.0 (didn't test further back). The new compare as 
bytes methods are only matching existing semantics, and the issue itself is 
that when we try to compare this type, we "normalize" it, which mutates the 
value; this normalization is not well documented and should be more explicit to 
users

  was:
Found by CASSANDRA-18504

When converting the BB to comparable bytes, converting back returns a different 
set of bytes for OSS42

{code}
java.lang.AssertionError: Property falsified after 18 example(s) 
Smallest found falsifying value(s) :-
Type:
decimal
Values: [-9.05674E-92]
Cause was :-
org.junit.ComparisonFailure: [fromComparableBytes(asComparableBytes(bb)) != bb; 
version OSS42] expected:<"0000006[1f22e36]"> but was:<"0000006[2ff75ce1c]">
{code}


> Document that DecimalType violates property serialize(deserialize(bb)) != bb 
> when used as a clustering column
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18530
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18530
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL/Semantics
>            Reporter: David Capwell
>            Priority: Normal
>             Fix For: 5.x
>
>
> Found by CASSANDRA-18504
> When converting the BB to comparable bytes, converting back returns a 
> different set of bytes for OSS42
> {code}
> java.lang.AssertionError: Property falsified after 18 example(s) 
> Smallest found falsifying value(s) :-
> Type:
> decimal
> Values: [-9.05674E-92]
> Cause was :-
> org.junit.ComparisonFailure: [fromComparableBytes(asComparableBytes(bb)) != 
> bb; version OSS42] expected:<"0000006[1f22e36]"> but 
> was:<"0000006[2ff75ce1c]">
> {code}
> EDIT:
> After more testing and talking with [~blambov], this is expected behavior and 
> been this way since at least 3.0 (didn't test further back). The new compare 
> as bytes methods are only matching existing semantics, and the issue itself 
> is that when we try to compare this type, we "normalize" it, which mutates 
> the value; this normalization is not well documented and should be more 
> explicit to users



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to