git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2684) AssertionError on RexBuilder when creating BigDecimal RexLiteral


Ruben Quesada Lopez created CALCITE-2684:
--------------------------------------------

             Summary: AssertionError on RexBuilder when creating BigDecimal RexLiteral
                 Key: CALCITE-2684
                 URL: https://issues.apache.org/jira/browse/CALCITE-2684
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.17.0
            Reporter: Ruben Quesada Lopez
            Assignee: Julian Hyde
             Fix For: 1.18.0


The method {{RexBuilder#makeExactLiteral(java.math.BigDecimal)}} throws an AssertionError if the BigDecimal parameter has an unscaled value that overflows long:
{code:java}
public RexLiteral makeExactLiteral(BigDecimal bd) {
    ...
    long l = bd.unscaledValue().longValue(); // narrowing conversion BigInteter to long
    ...
    assert BigDecimal.valueOf(l, scale).equals(bd); // assert fails if l overflew long
    ...
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)