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

Danny Chan commented on CALCITE-3065:
-------------------------------------

Firstly Calcite did set the numeric SqlLiteral value as BigDecimal after sql 
parsing. But during validating, it will fix up the type base on the decimal 
precision/scale, e.g. A decimal (10, 0) will be fixed as a SqlLiteral with Int 
sql type.

So with a validated SqlNode, we would get the right type. Spark is type strict 
consistent for comparing. But Calcite is not, saying, we allow a int = float in 
our plan. So i think you should use a validated SqlNode tree for you spark 
planner.

> RexLiteral#getValueAs should consider primitive type
> ----------------------------------------------------
>
>                 Key: CALCITE-3065
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3065
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jiatao Tao
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2019-05-13-12-04-36-365.png
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> !image-2019-05-13-12-04-36-365.png!



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

Reply via email to