[ 
https://issues.apache.org/jira/browse/PHOENIX-2734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15187667#comment-15187667
 ] 

James Taylor commented on PHOENIX-2734:
---------------------------------------

bq. At that place the actualType is PVarchar and the type we check is PDate
In that case, we first convert the value to the expected type (which would 
throw if it can't be converted) and then catch and rethrow an 
IllegalDataException 
{code}
        try {
            value = type.toObject(value, actualType);
        } catch (IllegalDataException e) {
            throw TypeMismatchException.newException(type, actualType, 
value.toString());
        }
{code}
We should move away from checking against specific types as it makes the code 
brittle. Your changes are definitely an improvement, but I think the above 
would be an improvement.


> Literal expressions for UNSIGNED_DATE/UNSIGNED_TIME/etc
> -------------------------------------------------------
>
>                 Key: PHOENIX-2734
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2734
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Sergey Soldatov
>            Assignee: Sergey Soldatov
>         Attachments: PHOENIX-2734.patch
>
>
> At the moment LiteralExpression accepts convertion from varchar to  PDate, 
> PTimestamp and PTime, but not for the PUnsigned... type. Is there any reason 
> for that or we can just add an additional check for Unsigned types as well? 
> The problem is that there is no way to load values to Unsigned date/time 
> types using bulk load ( for regular upsert there is an workaround to use 
> TO_TIME/etc functions). [~pctony] what do you think?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to