Paul Rogers created IMPALA-7898:
-----------------------------------

             Summary: LiteralExpr fails with class cast expression for some 
invalid DECIMAL values
                 Key: IMPALA-7898
                 URL: https://issues.apache.org/jira/browse/IMPALA-7898
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
    Affects Versions: Impala 3.0
            Reporter: Paul Rogers
            Assignee: Paul Rogers


Suppose that we run this simple test:

{code:java}
LiteralExpr.create("123.1", ScalarType.createDecimalType(4, 2));
{code}

This method calls {{NumericLiteral.uncheckedCastTo()}} which will return a 
{{CastExpr}}. The code then casts this to a {{LiteralExpr}}, which will fail 
with a runtime {{ClassCastException}}.

We should provide a clearer error message such as explaining that the value is 
invalid for the given type rather than just throwing a seemingly-unrelated 
exception.




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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to